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
I'm using react-jsonschema-form to generate UI with the schema generated by typson.
Current generated schema for:
export enum CallDirection { Inbound, Outbound }
is :
{ "id": "CallDirection", "enum": [ "Inbound", "Outbound" ] }
There is no type property in the generated schema. But react-jsonschema-form requires a type property to render the UI.
type
So I try to define the string enums like this:
type CallDirection = "Inbound" | "Outbound";
But typson will report error:
lib/Config.ts(10,1): error TS1008: Unexpected token; 'module, class, interface, enum, import or statement' expected. lib/Config.ts(10,13): error TS1005: ';' expected. /Users/kevin.zeng/.config/yarn/global/node_modules/q/q.js:126 throw e;
I also try to add the type property by annotation, but it doesnot work:
/** * @type string */ export enum CallDirection { Inbound, Outbound }
Is there any suggestions for me to generate string enums with default values, like:
{ "id": "CallDirection", "type": "string", "enum": [ "Inbound", "Outbound" ], "default": "Outbound" }
Thanks in advance.
The text was updated successfully, but these errors were encountered:
No branches or pull requests
I'm using react-jsonschema-form to generate UI with the schema generated by typson.
Current generated schema for:
is :
There is no
type
property in the generated schema. But react-jsonschema-form requires atype
property to render the UI.So I try to define the string enums like this:
But typson will report error:
I also try to add the
type
property by annotation, but it doesnot work:Is there any suggestions for me to generate string enums with default values, like:
Thanks in advance.
The text was updated successfully, but these errors were encountered: