aws / aws/serverless-java-container
Swagger file generation on Spring Boot lambda
- Dominant language
- Java
- Stars
- 1.6k
- Forks
- 574
- PR merge metrics
- No merged PRs in 30d
Description
* 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")
})
```
Contributor guide
Assessment
This issue has not been assessed yet.