I'm submitting a ...
I confirm that I
@example tags placed on models should add examples to their respective properties
export interface TestInput {
/**
* a number prop
* @example 2
*/
number: number;
string: string;
}
"TestInput": {
"properties": {
"number": {
"type": "number",
"format": "double",
"description": "a number prop",
"example": 2
},
"string": {
"type": "string"
}
},
"required": [
"number",
"string"
],
"type": "object",
"additionalProperties": true
}
No example is generated for properties.
export interface TestInput {
/**
* a number prop
* @example 2
*/
number: number;
string: string;
}
"TestInput": {
"properties": {
"number": {
"type": "number",
"format": "double",
"description": "a number prop"
},
"string": {
"type": "string"
}
},
"required": [
"number",
"string"
],
"type": "object",
"additionalProperties": true
}
Version of the library: v3.x
Version of NodeJS: 12.16.1
When writing complex models, it is much more ergonomic to include examples above individual properties. Additionally, the inconsistency for @example support can be confusing. This should be a fairly simple change.
Not that I can tell
I like the idea, but I'd add on that we don't support @example for parameters either, i.e.:
/**
* @example name This is an example for name
*/
@Post('PostParamExample')
public async postParamExample(@Query() name: string): Promise<void> {
return;
}
That seems like a pretty simple change as well. My opinion is that @example should work everywhere description does.
I submitted a PR for this feature adding @example support for both parameters and properties
Most helpful comment
I submitted a PR for this feature adding @example support for both parameters and properties