We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Support const values (new in v6). https://json-schema.org/understanding-json-schema/reference/generic.html#constant-values
Input
{ "$id": "https://api.nn-group.com/t/nn-nl/2/json_schemas/forwardcache_notify_participation", "$schema": "http://json-schema.org/draft-07/schema#", "title": "Foo", "required": ["bar"], "additionalProperties": false, "properties": { "bar": { "const": true } } }
Expected output:
export interface Foo { bar: true; }
Current output:
export interface Foo { bar: { [k: string]: any; }; }
This feature was mentioned in #120 but as the scope of that is a bit too big for beginning contributors I thought I would split this feature out.
Any hints for json-schema-to-typescript newbies would be much appreciated.
The text was updated successfully, but these errors were encountered:
Convert json schema const values to typescript const values
539ec61
Resolves bcherny#263
I've been hoping someone would give this a try for about a year now and I've finally had a chance to give this a go in the PR above #264
Sorry, something went wrong.
Fixed in #290, published in v10.1.0.
Successfully merging a pull request may close this issue.
Support const values (new in v6). https://json-schema.org/understanding-json-schema/reference/generic.html#constant-values
Input
Expected output:
Current output:
This feature was mentioned in #120 but as the scope of that is a bit too big for beginning contributors I thought I would split this feature out.
Any hints for json-schema-to-typescript newbies would be much appreciated.
The text was updated successfully, but these errors were encountered: