Given the setup below, the parser only resolves Animal and AnimalFarmEntry. The parser should also resolve Cat and Dog.
api.yaml
openapi: 3.0.0
info:
title: Sample API
description: API description in Markdown.
version: 1.0.0
paths:
/farm:
get:
summary: Get the animal farm.
description: Optional extended description in Markdown.
responses:
200:
description: OK
content:
application/json:
schema:
$ref: 'schema.yaml#/components/schemas/AnimalFarm'
schema.yaml
components:
schemas:
Dog:
allOf:
- $ref: '#/components/schemas/Animal'
- type: object
properties:
breed:
type: string
Cat:
allOf:
- $ref: '#/components/schemas/Animal'
- type: object
properties:
breed:
type: string
Animal:
type: object
discriminator:
propertyName: className
required:
- className
properties:
className:
type: string
color:
type: string
default: red
AnimalFarm:
type: array
items:
$ref: '#/components/schemas/AnimalFarmEntry'
AnimalFarmEntry:
type: object
properties:
animal:
$ref: "#/components/schemas/Animal"
Given the setup below, the parser only resolves Animal and AnimalFarmEntry. The parser should also resolve Cat and Dog.
api.yaml
schema.yaml