You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The ts-json-schema-generator currently supports comments placed above properties, converting them into the corresponding description in the schema. However, it does not support adding descriptions for properties directly in the root JsDoc or inline. It would be a significant improvement to include either of these features, as the current approach of adding comments above each property can make TypeScript types harder to read and maintain.
Current situation
Works
Root comment
/** List of favorite fruit */
export typeFruitList{apple: number
tomato: number
pear: number}
Property comment above
/** List of favorite fruit */
export typeFruitList{apple: number/** It's a fruit? */
tomato: number/** Must not be more than 1000 */
pear: number}
Doesn't work, but would be amazing if it did
Description of properties in root comment
/** List of favorite fruit @tomato It's a fruit?@pear Must not be more than 1000*/
export typeFruitList{apple: number
tomato: number
pear: number}
Inline comments
/** List of favorite fruit */
export typeFruitList{apple: number
tomato: number/** It's a fruit? */
pear: number/** Must not be more than 1000 */}
The text was updated successfully, but these errors were encountered:
I'm suggesting is to use block tag syntax to assign descriptions to child types. Block tags are mostly used to describe function params, but it would be very useful to use it to describe type children and ts-json-schema-generator to parse it to child descriptions.
Example
Given this TS input
/** List of favorite fruit @tomato It's a fruit?@pear Must not be more than 1000*/
export typeFruitList{apple: number
tomato: number
pear: number}
Expected (desired)
..."FruitList": {
"description": "List of favorite fruit",
"properties": {
"apple": { "type": "number" },
"tomato": { "type": "number", "description": "It's a fruit?" },
"pear": { "type": "number", "description": "Must not be more than 1000" },
},
"required": ["apple", "tomato", "pear"],
"type": "object"
},
...
The
ts-json-schema-generator
currently supports comments placed above properties, converting them into the corresponding description in the schema. However, it does not support adding descriptions for properties directly in the root JsDoc or inline. It would be a significant improvement to include either of these features, as the current approach of adding comments above each property can makeTypeScript
types harder to read and maintain.Current situation
Works
Root comment
Property comment above
Doesn't work, but would be amazing if it did
Description of properties in root comment
Inline comments
The text was updated successfully, but these errors were encountered: