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
an empty object doesnt get converted to dts
Input Format: json schema Output Language: typescript
CLI, npm, or app.quicktype.io: Version: https://app.quicktype.io/
{ "id": "http://json-schema.org/geo", "$schema": "http://json-schema.org/draft-06/schema#", "type": "object", "properties":{} }
export type Name = {} // or whatever the typescsipt equivalent of an empty object is ^^
export type Name = {}
breaks
workaround:
wrap in subobject:
if(schema.type=="object" && !schema.properties){ jsonSchema = { type: "object", properties: { wrapper: jsonSchema }, required: ["wrapper"], additionalProperties: false } }
...
lines[0] = "" lines[1] = lines[1].replace(/wrapper: ([^;]*);/, `export type ${mainTypeName} = $1;`).trim() lines[2] = "" return ` ${lines.join("\n")} `.trim()
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Issue Type
an empty object doesnt get converted to dts
Context (Environment, Version, Language)
Input Format: json schema
Output Language: typescript
CLI, npm, or app.quicktype.io:
Version: https://app.quicktype.io/
Description
Input Data
{
"id": "http://json-schema.org/geo",
"$schema": "http://json-schema.org/draft-06/schema#",
"type": "object",
"properties":{}
}
Expected Behaviour / Output
export type Name = {}
// or whatever the typescsipt equivalent of an empty object is ^^Current Behaviour / Output
breaks
workaround:
wrap in subobject:
...
The text was updated successfully, but these errors were encountered: