openapi
openapi copied to clipboard
Fixed the data structure for OpenApi 3
- Enums can hold any value: boolean, strings, numbers...so just use JsonValue
- Items can point to Ref so wrap Schema inside ObjectOrReference
- Reorder ObjectOrReference because they are untagged, its better to check for Ref first
Signed-off-by: Hanif Ariffin [email protected]
Reorder ObjectOrReference because they are untagged, its better to check for Ref first
Is there a reason to keep ref_path in the "Objects" with this? My understanding of openapi is that $ref excludes the possibility of any other fields, if so i think it would make sense to
- Drop
ref_pathfrom the structs that are used as Objects - Fail parsing if a ref is encountered along with other properties
The current situation is odd as I implemented support for refs in a tool and then noticed that all the holes i left for ObjectOrReference::Ref were unused :-) But just swapping it may leave another hole instead, with e.g. Schema:ref_path being unused.