Skip to content

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
@github-actions github-actions bot mentioned this pull request Jul 29, 2024
ut0xygen pushed a commit to ut0xygen/openapi-typescript that referenced this pull request Aug 5, 2025
…emas when arrayLength option is true (openapi-ts#1784)

* Fix: Correct handling of minItems and maxItems with identical values 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

* chore: run lint fix
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