I am trying to create a response type combining a base type with core information and other optional types using inheritance. I need that my responses contains always the person related information, and the rest of the info if it exists.
Imagine I have declared some datatypes in datatypes files: Person, Address, PersonalId and Job. I include it in my API using !include and then I try to create my new type, but using ? in the types is not valid.
FullPersonInfo: type: [ Person, Address?, Id?, Job? ]
I also try to include the types using required false:
types: Person: !include person.raml Address: type: !include person.raml required: false Id: type: !include person.raml required: false Job: type: !include person.raml required: false
I only make it working using union with inheritance and making all possible combinations…