Swagger-core: @ApiOperation with list as responseClass<t/>

์— ๋งŒ๋“  2013๋…„ 07์›” 23์ผ  ยท  3์ฝ”๋ฉ˜ํŠธ  ยท  ์ถœ์ฒ˜: swagger-api/swagger-core

์•ˆ๋…•ํ•˜์„ธ์š”,

@ApiOperation ์ฃผ์„์˜ responseType ์†์„ฑ์„ ๊ฐ์ฒด ๋ชฉ๋ก์œผ๋กœ ์–ด๋–ป๊ฒŒ ์„ค์ •ํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๊นŒ?

๊ฐ€์žฅ ์œ ์šฉํ•œ ๋Œ“๊ธ€

swagger-core 1.2.x์—์„œ:

responseClass = "com.yourpackage.YourModel", multiValuedResponse=true

swagger-core 1.3-x์—์„œ:

response = YourModel.class, responseContainer="List"

ํ›„์ž์˜ ์žฅ์ ์€ ์œ ํ˜• ์•ˆ์ „ํ•˜๋‹ค๋Š” ๊ฒƒ์ž…๋‹ˆ๋‹ค.

๋ชจ๋“  3 ๋Œ“๊ธ€

swagger-core 1.2.x์—์„œ:

responseClass = "com.yourpackage.YourModel", multiValuedResponse=true

swagger-core 1.3-x์—์„œ:

response = YourModel.class, responseContainer="List"

ํ›„์ž์˜ ์žฅ์ ์€ ์œ ํ˜• ์•ˆ์ „ํ•˜๋‹ค๋Š” ๊ฒƒ์ž…๋‹ˆ๋‹ค.

์•ˆ๋…•ํ•˜์„ธ์š”, ์ €๋Š” responseContainer = "List"๋ฅผ ์‚ฌ์šฉํ•˜๊ณ  ์žˆ์ง€๋งŒ swagger UI์—์„œ List[$ObjectDesc]๋ฅผ ํ‘œ์‹œํ•˜๊ณ  ์žˆ์Šต๋‹ˆ๋‹ค. ์–ด๋– ํ•œ ์ œ์•ˆ? responseContainer="Array"๋ฅผ ์‚ฌ์šฉํ•˜๋ ค๊ณ  ํ•  ๋•Œ์™€ ๊ฐ™์€ ๊ฒฝ์šฐ

@vvicario - ๋ฌธ์ œ๊ฐ€ ์žˆ๋Š” ๊ฒฝ์šฐ ๋ณ„๋„์˜ ๋ฌธ์ œ๋ฅผ ์—ด์–ด์ฃผ์„ธ์š”.

์ด ํŽ˜์ด์ง€๊ฐ€ ๋„์›€์ด ๋˜์—ˆ๋‚˜์š”?
0 / 5 - 0 ๋“ฑ๊ธ‰