-
-
Notifications
You must be signed in to change notification settings - Fork 347
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
fix: required of parent schema not considered in allOf #1570 #1659
Conversation
I think this still needs to be adjusted to handle edge cases where both the parent and the sub schema have a Like:
Currently only the parent |
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.
@MGabr
Thanks for nice update. i added a comment.
@@ -0,0 +1,59 @@ | |||
openapi: 3.0.1 |
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.
could you merge the yaml of these test files?
I don't wanna separeate related 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.
Sure, I merged those two into the existing polymorphic.yaml
file now
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.
Thanks!
Status
READY
Description
Fixes #1570
Given a schema like
the
allOf
was considered as schema on its own when resolving the value of the fields, but in fact we want to consider therequired
fields of the parent schema also for theallOf
sub schema.This fixes this by including the
required
field of the parent schema in the sub schema.Related PRs
There is this existing outdated PR: #861
Todos
Steps to Test or Reproduce
The TypeScript model generated for the new
polymorphic-required.yaml
test spec should have the required fields set correctly.So for
it generates