Skip to content
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

Ensure not required parameters are created as optional properties #1053

Merged
merged 2 commits into from
Apr 7, 2023

Conversation

AplusKminus
Copy link
Contributor

Changes

Adds the missing dependency vite and fixes #1052.
Vitest requires vite to run. See the docs.

How to Review

The fix is in src/transform/components-object.ts, the rest is just test adjustments, updated snapshots and the added dependency.

Checklist

  • Unit tests updated
  • README updated
  • examples/ directory updated (if applicable)

@AplusKminus AplusKminus mentioned this pull request Mar 20, 2023
3 tasks
Copy link
Contributor

@drwpow drwpow left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks great, thank you! Apologies for the merge conflict; happy to merge once that’s sorted 🙂

…i-ts#1052)

According to the OpenAPI 3.1.0 spec, a parameter is required if one of these matches:
- it has 'in: "path"'
- it has 'required: true'

See spec at Parameter Object - Fixed Fields:
https://spec.openapis.org/oas/v3.1.0#fixed-fields-9

Fixes openapi-ts#1052
@AplusKminus
Copy link
Contributor Author

Hi Drew, I rebased the branch and fixed the merge conflicts. :)

@drwpow drwpow merged commit c36838d into openapi-ts:main Apr 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Non-Required-Query-Parameters in Components are always generated as required
2 participants