You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, I'm having issues getting an example spec using allOf to work. This is the spec, as provided by the OpenAPI docs:
openapi: 3.0.0info:
title: AllOf.v1version: '1.0'servers:
- url: 'http://localhost:3000'paths:
/pets:
patch:
requestBody:
content:
application/json:
schema:
oneOf:
- $ref: '#/components/schemas/Cat'
- $ref: '#/components/schemas/Dog'discriminator:
propertyName: pet_typeresponses:
'200':
description: Updatedcomponents:
schemas:
Pet:
type: objectrequired:
- pet_typeproperties:
pet_type:
type: stringDog: # "Dog" is a value for the pet_type property (the discriminator value)allOf: # Combines the main `Pet` schema with `Dog`-specific properties
- $ref: '#/components/schemas/Pet'
- type: object# all other properties specific to a `Dog`properties:
bark:
type: booleanbreed:
type: stringenum: [ Dingo, Husky, Retriever, Shepherd ]Cat: # "Cat" is a value for the pet_type property (the discriminator value)allOf: # Combines the main `Pet` schema with `Cat`-specific properties
- $ref: '#/components/schemas/Pet'
- type: object# all other properties specific to a `Cat`properties:
hunts:
type: booleanage:
type: integer
My test attempts to send a JSON PATCH request to the /pets endpoint, using:
Hi, I'm having issues getting an example spec using
allOf
to work. This is the spec, as provided by the OpenAPI docs:My test attempts to send a JSON
PATCH
request to the/pets
endpoint, using:However, this only results in:
Digging in a bit more, it appears that the validator doesn't see the
pet_type
property it should be inheriting from thePet
component.Any experience with this, or ideas? Thanks in advance.
The text was updated successfully, but these errors were encountered: