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(oas): Improve OAS by adding missing type object to schemas #3177
Conversation
|
@patrick-medusajs did we already do this with your OAS work or would it make sense to include? |
@srindom We did similar work but we didn't fix objects in arrays. We actually have a Linear for it - CORE-1024. @shahednasser How would you like to proceed for merging such changes. Should it target |
I don't think this change is necessary for |
@asprouse Would would mind rebasing your branch to point to |
09706df
to
f473164
Compare
@patrick-medusajs I rebased the PR as re-targeted it to |
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.
LGTM
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.
LGTM! @asprouse before we merge, can I get you to merge in latest from develop
and push?
🎉 @asprouse, thank you for your contribution. Cheers! |
This PR improves the OAS by adding `type: object` to schemas that have `properties` and no `type`. While this attribute is not required for a valid spec, omitting it opens the possibilities of non-object input. See https://stackoverflow.com/a/47390723 for a detailed description of this behavior. When generating code or schemas from an OAS with tools like takeshape.io having `type` attributes is important to get the correct behavior.
This PR improves the OAS by adding
type: object
to schemas that haveproperties
and notype
. While this attribute is not required for a valid spec, omitting it opens the possibilities of non-object input. See https://stackoverflow.com/a/47390723 for a detailed description of this behavior. When generating code or schemas from an OAS with tools like takeshape.io havingtype
attributes is important to get the correct behavior.