-
Notifications
You must be signed in to change notification settings - Fork 327
Open
Description
I have the following typescript definitions file test.ts
:
interface AddressInfo {
/**
* @default xxx
*/
address: string;
}
interface UserInfo {
/**
* @default xxx
* @label xxx
*/
name: string;
/**
* some desc ...
*
* @label xxx
*/
extra: AddressInfo
}
I generated the schema using
typescript-json-schema test.ts UserInfo --out schema.json --validationKeywords label
and the generated schema is the following:
{
"$schema": "http://json-schema.org/draft-07/schema#",
"definitions": {
"AddressInfo": {
"properties": {
"address": {
"default": "xxx",
"type": "string"
}
},
"type": "object"
}
},
"properties": {
"extra": {
"$ref": "#/definitions/AddressInfo",
"description": "some desc ..."
},
"name": {
"default": "xxx",
"label": "xxx",
"type": "string"
}
},
"type": "object"
}
As can be seen, the extra
property contains the $ref and the description
but is missing the label
annotation.
Metadata
Metadata
Assignees
Labels
No labels