-
-
Notifications
You must be signed in to change notification settings - Fork 432
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
feat: support default value binding with allOfSchema #885
Conversation
need tests? |
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.
need tests?
Well, yeah. Please think proactively about this free software thing.
Here it's clear you should at the very least add a test for the behavior you're changing, so add a func TestIssue884
in openapi3filter/issue884_test.go
that makes sure a default can be extracted from the allof schema you mention elsewhere.
I'd also add a test that shows the break
behavior, i.e.: the first non-nil default of allofs is the one picked.
Thanks for the patch :)
I added tests |
- in: query | ||
name: withManyDefaults | ||
schema: | ||
allOf: |
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.
this definition should be schema validation error ?
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'm unable to find in the spec à justification to "forbid multiple schema defaults". But if you find one then yes let's impl this validation pass.
Otherwise let's continue to not return a validation error here.
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.
Yes, it is not required according to the specifications.
LGTM. If you feel this in a good state as is I'll merge. |
Yes, it's ready 🚀 |
📝 nested complex structure is not supported with this PR