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: add override for bad usage of anyOf #349

Merged
merged 5 commits into from
May 5, 2023
Merged

fix: add override for bad usage of anyOf #349

merged 5 commits into from
May 5, 2023

Conversation

wolfy1339
Copy link
Member

See octokit/types.ts#534


Behavior

Before the change?

  • The OpenAPI spec had bad usage of anyOf, trying to use it to make one property required at a time (either or)

After the change?

  • Use a oneOf instead, as both properties can't be present at the same time, and put the different properties in 2 schemas inside of that oneOf
  • The OpenAPI spec can now result in proper types

Other information

Additional info

Pull request checklist

  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been reviewed and added / updated if needed (for bug fixes / features)
  • Added the appropriate label for the given change

Does this introduce a breaking change?

Please see our docs on breaking changes to help!

  • Yes (Please add the Type: Breaking change label)
  • No

If Yes, what's the impact:

  • N/A

Pull request type

Please add the corresponding label for change this PR introduces:

  • Bugfix: Type: Bug

@wolfy1339 wolfy1339 added the Type: Bug Something isn't working as documented label Apr 28, 2023
@wolfy1339
Copy link
Member Author

For easier reviewing, since GitHub doesn't want to show the diff online, or generate a diff/patch file, here are the diffs for each commit.

0001-fix-add-override-for-bad-usage-of-anyOf.txt
0002-build-generate-openapi-specs.txt
0003-fix-add-override-for-bad-anyOf-in-pulls-request-revi.txt
0004-build-generate-openapi-specs.txt

Copy link
Member

@kfcampbell kfcampbell left a comment

Choose a reason for hiding this comment

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

It's unclear to me why the diff isn't displaying. The changes in your linked text files look reasonable to me as a workaround while we wait for the upstream issue to be fixed.

@wolfy1339 wolfy1339 merged commit b6f1340 into main May 5, 2023
@wolfy1339 wolfy1339 deleted the fix-bad-anyOf branch May 5, 2023 18:08
@octokitbot
Copy link
Collaborator

🎉 This PR is included in version 11.1.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
released Type: Bug Something isn't working as documented
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

3 participants