I have type definitions similar to the following:
enum: [one, two, three]
The idea is that OneTwo is suitable for types of 'one' and 'two', only 'three' requires a specialization.
Then I added the following example in a response body:
Now the API Workbench complains:
None of the 'OneTwo' type known subtypes declare 'one' as value of discriminating property 'type'.
Am I really required to define subtypes for all variants, even though the base type is sufficient?
As far as I can see I have the following options:
- Add "empty" subtype definitions
- Merge "onlyForThree" into OneTwo and make it optional
- Keep OneTwo and Three separate, but remove the type discrimination. From a technical POV it's similar to option #2, but semantically different.
I'm wondering if there is a better way to achieve what I want?