Swagger file generation on Spring Boot lambda

未关闭
#338 2 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
30/100
Issue 类型
功能
描述清晰度
基本清楚
活跃度
停滞
技术栈
aws, java, spring-boot
领域
api, backend, cloud

调研方向

首先检查 issue 中描述的 Swagger2Config 和带注解的控制器映射,然后检查 Spring Boot 应用程序如何作为 Lambda 部署。确定已部署的 Lambda 是否能够提供 swagger-ui.html,并定义一条可验证的访问路径;完成的标准是部署后能够访问 Swagger UI,或者已记录受支持的限制。

由索引模型根据 Issue 内容生成。

描述

  • 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:

        <dependency>
            <groupId>io.springfox</groupId>
            <artifactId>springfox-swagger2</artifactId>
            <version>2.6.1</version>
            <scope>compile</scope>
        </dependency>

        <dependency>
            <groupId>io.springfox</groupId>
            <artifactId>springfox-swagger-ui</artifactId>
            <version>2.6.1</version>
            <scope>compile</scope>
        </dependency>

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")
    })
主要语言
Java
星标
1.6k
派生
575
平均合并
1 天 15 小时
30 天内合并 PR
12

环境准备

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

aws/serverless-java-container 的其他 Issue

查看 aws/serverless-java-container 的全部 Issue

相似的 Issue

更多 Java Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。