-
-
Notifications
You must be signed in to change notification settings - Fork 272
Non ascii discriminator mapping fix #2471
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
Non ascii discriminator mapping fix #2471
Conversation
Adds ref with non-ascii typename to testcases with discriminator mapping that. Before fix these generate type unions where the mapping is ignored for the non-ascii typename.
So that the ref has been resolved with "decodeURI" in parseRef. Without this change, discriminator mapping for non-ascii typenames did not work.
|
|
🦋 Changeset detectedLatest commit: 82af768 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
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 |
|
@josstn is attempting to deploy a commit to the Hey API Team on Vercel. A member of the Team first needs to authorize it. |
commit: |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #2471 +/- ##
=======================================
Coverage 22.58% 22.58%
=======================================
Files 337 337
Lines 33398 33398
Branches 1309 1309
=======================================
Hits 7543 7543
Misses 25846 25846
Partials 9 9
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
mrlubos
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice to see you again @josstn and thanks for the fix! Should I even ask what kind of schemas you're working with to run into this bug? 😬
|
Thanks for the quick response @mrlubos! And to answer your question, no you don't wanna know 😉 But if you really wanna know, the spec i'm working on is generated from a somewhat big java codebase not written with openapi spec generation in mind. And it is norwegian 🙃 |
|
My pleasure! Literally, you created a very "easy to merge" pull request. Thanks for the additional context as well, it's fun to hear what kind of APIs people work with |
If a type name referenced in a discriminator mapping has non-ascii characters, the resolving of the mapping into a union type failed because the $ref value used in the lookup was uri encoded, and the typename in the lookup was not.
This change fixes that by using the $ref value which has been uri decoded for the lookup.