Description
Hello open api experts, i meet some issue and want some help from you.
It is about polymorphism. i find some example here : #2116. want to reuse the pet scenario as example.
I define Pet, Cat, Dog. 3 yaml files.
Also, I have a entity Person
, the yaml file like below.
description: Structure of person.
type: object
properties:
name:
type: string
pet:
$ref: 'pet.yaml'
required:
- name
- pet
what i find is, if i use above yaml, Pet.java can be generated, but there is no cat.java and dog.java generated.
Then i update the Person.yaml file like blew :
description: Structure of person.
type: object
properties:
name:
type: string
pet:
oneOf:
- $ref: '#/components/schemas/Dog'
- $ref: '#/components/schemas/Cat'
required:
- name
- pet
The generated Person.java file has some error, the filed "pet" 's. type is "OneOfDogCat", and then it complain the "OneOfDogCat" class with complier error.
I think 1st approach seems better, but not sure why client not generate the Dog.java and Cat.java file. Do you have any ideas on this problem, any suggestion is appreciate.