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
Allow unicode characters in type name #279
Comments
My scenario:
(Maybe another bug to fix: do not generate blank type name) |
A minimium schema would cause this error: {
"type": "object",
"title": "呵呵",
"properties": {
"some_key": {
"type": "string",
"title": "哈哈"
}
}
} |
Sounds good to me! Want to put up a Pull Request? |
Fix the blank name bug in #280 Allow unicode is a little complicated, would be later |
Thanks for the fix, but I think supporting Unicode (as you suggested) could be a better way to do it. What issues are you running into? |
Got a doc: Valid JavaScript variable names in ES2015 https://github.com/purplecabbage/valid-identifier First download for most times, but seems not active; others are not widely adopted (npm downloads) |
I am working on this. I wanted to confirm that this project targets ES5. I'm considering using Unicode aware regex, but it appears to be only supported from ES2015. If using ES5, I found https://github.com/mathiasbynens/regexpu. Additionally, are there any concerns about backwards compatibility or previously generated names? |
json-schema-to-typescript/src/utils.ts
Line 164 in d898361
The member of type name is restricted to only english letters (and some symbol)
Typescript now allows unicode characters (doc link)
So, modify this function to allow unicode characters in type name, or as an option?
The text was updated successfully, but these errors were encountered: