openapi-typescript
openapi-typescript copied to clipboard
requestBody fields optional even with defaults
Changes
Noticed that when a request body field had a default value, that it was being specified as required. This would change it to be treated like a parameter with a default value.
How to Review
Let me know if the premise correct and then I could look into updating the tests.
Checklist
- [ ] Unit tests updated
- [ ]
docs/updated (if necessary) - [ ]
pnpm run update:examplesrun (only applicable for openapi-typescript)
⚠️ No Changeset found
Latest commit: 71a6e5292d63b7b4cead2aec3321c00dc5cf7566
Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.
This PR includes no changesets
When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types
Click here to learn what changesets are, and how to add one.
Click here if you're a maintainer who wants to add a changeset to this PR
I think this is an improvement, thank you! Yes if you update the tests and it’s clear there are no breakages I’d be open to this change.
This looks great, thanks again! Examples updated makes sense, too.
To merge this, would love to add a test, maybe in request-body-object.test.ts. The changes to the examples look correct, but those don’t always get checked for every single change so a unit test would ensure this doesn’t regress in the future. Great work!
Thanks! Good call, added a test