-
Notifications
You must be signed in to change notification settings - Fork 329
Removed invalid tokens from generic type names #461
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
Conversation
a62cb19
to
cb59f6b
Compare
cb59f6b
to
8835889
Compare
I don't want to make this major change. Please make a fork if you want this change. |
@domoritz would you accept a PR that just url-escapes the url generated for the refs? typescript-json-schema/typescript-json-schema.ts Line 1417 in 75e599a
would become $ref: `${this.args.id}#/definitions/` + encodeURIComponent(fullTypeName), or $ref: encodeURI(`${this.args.id}#/definitions/` + fullTypeName), |
How would that affect what genetics look like? If the json schema spec says something about what's allowed, I'm happy to change things. But I want to make sure things remain readable. |
the generics would remain the same in the definition, so Some json-schema library are strict about the fact that |
I have not seen a library that doesn't think these urls are valid. Would be libraries be open to change? I think these days people expect urls to work even without escaped characters (as it does in browser address fields) even when the url is under the hood encoded. |
Having said that, I don't feel too strongly about the change you proposed and would be happy to accept it. |
I'm having issues with this library, that triggered this discussion. They make uri interpretation strict recently: https://github.com/Stranger6667/jsonschema/blob/master/crates/jsonschema-py/CHANGELOG.md#changed-5 While annoying I feel like they are doing the correct thing here, since json schema defines $refs as URI, and uri do require percent encoding.
Ok, will do. Do you also prefer I open an issue to reference it in changelogs etc? |
Yes, issue and pull request would be great. |
I could work on this in these days. I'll open a new issue soon. |
Created #617 |
Please:
Readme.md
Fixes #454
Generics type names were being created with '<,>' characters when using theses as URI for the $ref fields they are invalid. Changing this also fixed #454 .