olivierlsc / swagger-express-ts

Generate and serve swagger.json
MIT License
147 stars 60 forks source link

"Array of" as endpoint response #52

Open WeekendMan opened 5 years ago

WeekendMan commented 5 years ago

"itemType" has to be added to response description too. For now it's impossible (or I can't find how to) set, for example, something like this:

@ApiOperationGet({
  description: 'Blahblahblah',
  path: '/some-path',
  responses: {
    200: {
      description: 'Successful request',
      type: SwaggerDefinitionConstant.Response.Type.ARRAY,
      itemType: SwaggerDefinitionConstant.STRING
    }
}

Response example:

[ 'a', 'b', 'c' ]