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

Fix boolean props #2199

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

StefanTerdell
Copy link

@StefanTerdell StefanTerdell commented Mar 13, 2025

Changes

This PR adds support for boolean property schemas, ie:

{
  "type": "object",
  "properties": {
    "truthy": true,
    "falsy": false
  }
}

The PR changes the flow in the loop handling object properties to reach "edge-case" handling that was already present for boolean schemas. This was previously not reached due to an early error that was thrown if the property schema was not an object. Properties that were previously accessed directly from the schema object are now extracted conditionally before hand.

Closes #2198.

How to Review

See the added test case for details.

Checklist

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

@StefanTerdell StefanTerdell requested a review from a team as a code owner March 13, 2025 12:09
@StefanTerdell StefanTerdell requested a review from gzm0 March 13, 2025 12:09
Copy link

netlify bot commented Mar 13, 2025

👷 Deploy request for openapi-ts pending review.

Visit the deploys page to approve it

Name Link
🔨 Latest commit 5617b57

Copy link

changeset-bot bot commented Mar 13, 2025

🦋 Changeset detected

Latest commit: 5617b57

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

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.

Unexpected error when property schemas are boolean
1 participant