Skip to content

fix: --properties-required-by-default flag #1764

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 4 commits into from
Jul 17, 2024
Merged

fix: --properties-required-by-default flag #1764

merged 4 commits into from
Jul 17, 2024

Conversation

michalfedyna
Copy link
Contributor

Changes

Fix --properties-required-by-default flag not working. #1651

How to Review

It was just simple typo.

Checklist

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

@michalfedyna michalfedyna requested a review from a team as a code owner July 16, 2024 12:09
Copy link

changeset-bot bot commented Jul 16, 2024

🦋 Changeset detected

Latest commit: 81ce5a6

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

@michalfedyna
Copy link
Contributor Author

@drwpow any chances of fast approve and release?

@drwpow
Copy link
Contributor

drwpow commented Jul 16, 2024

Thanks for the fix; this looks good to me! I’d love to add a test for this so this doesn’t regress in the future. And also please add a patch changeset (see comment) so the version can be bumped and released. But otherwise, this looks good and would be happy to merge when both of those items are in.

@michalfedyna
Copy link
Contributor Author

@drwpow Changeset done. It will be hard to test that part. The problem comes from cli.js not being part of the build process and static analysis not being done on that file. I will take some time over the weekend and make it work if you wish. But for now is it possible to merge that change? It will be helpful for me at work.

@drwpow
Copy link
Contributor

drwpow commented Jul 17, 2024

So there are CLI tests for flags already. A lot of them had been moved into the Node API tests, but for this change, we could just do a simple expect(…).toMatchFileSnapshot() test to make sure it’s working as-expected. It would also just help prevent these regressions in the future!

@michalfedyna
Copy link
Contributor Author

@drwpow Should be done! You can run diff ./examples/github-api.ts ./examples/github-api-required.ts to check if flag works as you expect.

@michalfedyna
Copy link
Contributor Author

And I'm testing against ./example/github-api-required.ts

@drwpow
Copy link
Contributor

drwpow commented Jul 17, 2024

Awesome, thank you so much! That works—just something that verifies a) this is the correct fix, and b) we’ll see a test failure if this regresses. That saves a ton of work in the long term; appreciate it!

@drwpow drwpow merged commit 2793049 into openapi-ts:main Jul 17, 2024
7 checks passed
@michalfedyna
Copy link
Contributor Author

Great, thanks!

@github-actions github-actions bot mentioned this pull request Jul 19, 2024
kerwanp pushed a commit to kerwanp/openapi-typescript that referenced this pull request Jul 29, 2024
* fix: --properties-required-by-default flag

* chore: add changeset

* test: --properties-required-by-default flag

* style: lint cli.style.ts
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.

2 participants