|
OperationMetadataStorage.defineMetadata(target, options, propertyKey); |
thus the parameters are not generated when specified
@ApiOperation({
summary: 'Gets user by id',
methods: ['get'],
path: '/users/{id}',
parameters: [
{
name: 'id',
in: 'path',
required: true,
example: 1,
schema: {
type: 'integer',
minimum: 1
}
}
]
})
show(id: string): User {
return {
id,
name: '',
email: ''
};
}
Actual Result:
{
"paths": {
"/users/{id}": {
"get": {
"summary": "Gets user by id",
"parameters": [],
"responses": {},
"security": []
}
}
}
}
Expected Result:
{
{
"paths": {
"/users/{id}": {
"get": {
"summary": "Gets user by id",
"parameters": [
{
"name": "id",
"in": "path",
"required": true,
"example": 1,
"schema": {
"type": "integer",
"minimum": 1
}
}
],
"responses": {},
"security": []
}
}
}
}
openapi-typescript/packages/openapi-metadata/src/decorators/api-operation.ts
Line 13 in 99c346e
thus the parameters are not generated when specified
Actual Result:
{ "paths": { "/users/{id}": { "get": { "summary": "Gets user by id", "parameters": [], "responses": {}, "security": [] } } } }Expected Result:
{ { "paths": { "/users/{id}": { "get": { "summary": "Gets user by id", "parameters": [ { "name": "id", "in": "path", "required": true, "example": 1, "schema": { "type": "integer", "minimum": 1 } } ], "responses": {}, "security": [] } } } }