aws / aws/serverless-java-container

Swagger file generation on Spring Boot lambda

未關閉
#338 2 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視
主要語言
Java
星號
1.6k
分支
574
PR 合併指標
30 天內沒有已合併 PR

描述

* Implementations: Spring Boot

## Scenario
I have annotated my spring boot 2 lambda with a Swagger2Config so that it auto-generates a Swagger-file for the annotated methods in the controller. Is there a way to access the swagger-ui.html after deploying the lambda? The annotated request mapping are reacheable just fine.

## Steps to reproduce
Add these maven dependencies to your spring boot 2 mvn lambda:

```

io.springfox
springfox-swagger2
2.6.1
compile


io.springfox
springfox-swagger-ui
2.6.1
compile

```
Add a Swagger2Config file and annotate the controller methods with Swagger annotations.

```
@RequestMapping(path = "/categories", method = RequestMethod.POST)
@ApiOperation(value="Add a new category",response=Category.class)
@ApiResponses(value={
@ApiResponse(code=200,message="Category created successfully",response=Category.class, responseContainer="List"),
@ApiResponse(code=500,message="Internal server error")
})
```

貢獻指南

開啟貢獻指南

研究方向

先檢視 issue 中描述的 Swagger2Config 與加上註解的控制器對映,接著檢查 Spring Boot 應用程式如何以 Lambda 的形式部署。確認已部署的 Lambda 是否能夠公開 swagger-ui.html,並定義可驗證的存取路徑;完成的標準是部署後可以存取 Swagger UI,或已記錄受支援的限制。

由索引模型根據 Issue 內容生成。

評估

技術堆疊
aws, java, spring-boot
領域
api, backend, cloud
Issue 類型
功能
難度
4/5
預估耗時
3-5 天
活躍度
停滯
描述清晰度
基本清楚
新手友好度
30/100

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。