-
Notifications
You must be signed in to change notification settings - Fork 6k
Closed
Closed
Copy link
Milestone
Description
I used the Swagger Editor to create:
swagger: '2.0'
info:
version: "0.0.1"
title: Response annotation test
paths:
/person:
get:
summary: Get all person api
responses:
200:
description: Get all person
schema:
type: array
items:
$ref: '#/definitions/Person'
500:
description: Unexpected error(s)
schema:
$ref: '#/definitions/ApiError'
definitions:
Person:
type: object
properties:
name:
type: string
ApiError:
type: object
properties:
errorMsg:
type: string
Then I generated JAX-RS Server code from the editor. Here is the APIResponses section in the PersonApi class:
@io.swagger.annotations.ApiResponses(value = {
@io.swagger.annotations.ApiResponse(code = 200, message = "Get all person", response = Person.class, responseContainer = "List"),
@io.swagger.annotations.ApiResponse(code = 500, message = "Unexpected error(s)", response = Person.class, responseContainer = "List") })
The 'response' and 'responseContainer' annotations from the 200 response block got used in the 500 ApiResponse.
nachii