Skip to content

Fix: Correct handling of identical minItems and maxItems in array schemas when arrayLength option is true #1784

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

Merged
merged 2 commits into from
Jul 29, 2024

Conversation

yoshi2no
Copy link
Contributor

@yoshi2no yoshi2no commented Jul 26, 2024

ref: #1781

Changes

  • Corrects handling of array schemas with identical minItems and maxItems when arrayLength option is true
  • Adds test case

How to Review

The added test should pass.

Checklist

  • Unit tests updated
  • docs/ updated (if necessary)
  • pnpm run update:examples run (only applicable for openapi-typescript)

…in array schemas

- Resolved issue where the generated interface was [] when minItems and maxItems were identical
- Now generates a tuple type for such cases
- Added test case for OpenAPI specification with minItems and maxItems set to 2
@yoshi2no yoshi2no requested a review from a team as a code owner July 26, 2024 17:13
Copy link

changeset-bot bot commented Jul 26, 2024

🦋 Changeset detected

Latest commit: 200000e

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
openapi-typescript Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link
Contributor

@kerwanp kerwanp left a comment

Choose a reason for hiding this comment

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

Looks good to me 🚀

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.

Thank you!

@drwpow drwpow merged commit c2f8655 into openapi-ts:main Jul 29, 2024
7 checks passed
@github-actions github-actions bot mentioned this pull request Jul 29, 2024
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.

3 participants