问题标签 [swagger-3.0]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
0 回答
37 浏览

spring-boot - 配置 Open API 3 - 具有多个控制器类的 SpringBoot

我正在尝试为我的 springboot 应用程序配置 swagger 3 spring 文档。我有 3 个控制器类,每个控制器类有 1 个功能端点方法。如果我打开 swagger 文档,我只能在 Swagger UI 中看到第一个类的端点详细信息。

我的控制器类看起来像这样。

唯一的相似之处是所有这 3 个控制器都具有相似的端点 URL,但路由到不同的处理程序。仅供参考,我使用 java 11。

0 投票
1 回答
54 浏览

spring-boot - 如何在 Spring Boot 中使用 OpenAPI 3 Swagger 编写可能返回该类或该类的列表的 @ApiResponse

如文档中所写,如果我们想定义多个响应,我们可以将 anyOf 与 @Schema 一起使用。

我的控制器返回 aProduct或 a List<Product>。我想在我的 OpenAPI 3 文档中指定这一点。我想知道这是否可能。如果是,那么如何?如果否,那么是否有任何解决方法?

我不仅要指定List.class. 我想指定List<Product>.

PS:- 在谷歌上搜索并没有得到任何我可以使用的结果。

0 投票
1 回答
34 浏览

spring-boot - 我如何配置 swagger3 以使用 @SecurityScheme 支持 https 请求

我已经将我的项目更新到 Springboot 版本 2.6.3 和 swagger 3。我需要支持授权 HTTPS 请求但@SecurityScheme仅支持 https 请求。有没有办法配置@SecurityScheme注释以支持 https 请求或任何其他解决方案?

0 投票
1 回答
20 浏览

java - Failing to run Java Springboot app with Swagger3

I'm running a SpringBoot (2.2.2.RELEASE) java application with springfox.boot.starter:3.0.0 and when I run it locally from within my Eclipse IDE it works well. The problem is that when I package it as Docker image and run the container then when I try to run http://localhost:8089/swagger-ui/# it displays the default Swagger Petstore example.

Here is my Docket @Bean:

Obviously it's something related to running it from within a docker container, any idea what's missing to make it work?

Thank you!

EDIT:

Probably worth mentioning that I use to work with springfox:2.9.2 and it worked well both locally and as Docker container.