-
Notifications
You must be signed in to change notification settings - Fork 262
Parsing IOpenApiAny should respect format and type #343
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Parsing IOpenApiAny should respect format and type #343
Conversation
…e'll try to convert. - If type exists, then respect the type. If data conflicts with the type, throw an error. - If type doesn't exist, use best effort.
- add handling for compelx type
- Fix culture. - Move Field Map parameters out to their own files.
- Don't throw inside the convertor
Handle Example in MediaType and Parameter in V3
add more tests
fix the response deserializer
This changeset turned out to be much larger than I originally expected, as I kept going down the rabbit hole after discovering more and more nuances from the spec and the V2/V3 discrepancies. @darrelmiller It's ready for review now. Apologies for the PR size - on the upside, half of the files are tests and the remaining, except a few files, contain straightforward changes, so hopefully this is not too bad to review. |
new AnyListFieldMap<OpenApiParameter> | ||
{ | ||
{ | ||
"enum", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably would be good to have these as constants #Resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think my only comment here is... WOW. I did not expect this to turn out to be so much work. It is awesome though that you are walking OpenApiAny structures and making sure all the values are the right type.
Thanks for the review @darrelmiller! |
Fix #306
Parse IOpenApiAny with respect to
type
andformat
This handles parsingdefault
,enum
,example
, andexamples
in both V2 and V3.Validation rules added to validate whether there is a mismatch between the given type and the data itself.
The code is quite involved given that the schema type/format information may not reside at the same level as the Any itself (e.g. the Any deep down in
examples
field in media type needs information formschema
field).