springfox 相关问题

Springfox的java库套件都是为了使用spring系列项目自动生成JSON API的机器和人类可读规范。

如何在 Spring Boot 3.4 项目中实现 swagger ui [已关闭]

过去两年我使用 Springfox 开发 Spring Boot 应用程序。 Springfox 为您的 REST API 生成文档和测试 ui。 但实际上 Springfox 项目已经死了并且不支持

回答 3 投票 0

如何在 Springfox Swagger 提供的 Swagger /v2/api-docs 中启用 CORS 标头?

我的项目中有以下文件: @配置 @Order(Ordered.LOWEST_PRECEDENCE) 公共类 SwaggerConfig { @豆 公共 Docket apiSwagger2Documentation() { .... } } 并且在

回答 3 投票 0

如何将自定义Springdoc资源添加到swagger-ui页面

我不擅长 swagger 和相关库,如果标题令人困惑,很抱歉。 我有几个服务以 json 格式并通过 swagger-ui 提供它们的 api 作为 swagger 文档。接下来,...

回答 1 投票 0

Whitelabel 错误页面 Swagger,此应用程序没有 /error 的显式映射,因此您将其视为后备 swagger2:3.0.0-SNAPSHOT

尝试在 Spring Boot 2.3.1 中配置 swagger。 摇篮配置 存储库{ mavenCentral() maven { url 'http://oss.jfrog.org/artifactory/oss-snapshot-local/' } } 依赖项{

回答 5 投票 0

如何使用 Springfox 在 Swagger 中隐藏删除额外的请求正文参数

我有非常大的UserDto,有很多字段,如下所示: 公共类 UserDto 实现可序列化 { 私人长ID; @柱子 私有字符串用户名; @柱子 私有字符串 ema...

回答 2 投票 0

将 Springfox 从 2.9.2 版迁移到 3.0.0 后,Swagger 无法工作

我正在研究 Spring MVC 并尝试将 Springfox v. 2.9.2 迁移到 3.0.0。当我将版本更改为 3.0.0 时,出现错误: org.springframework.context.ApplicationContextException:失败...

回答 2 投票 0

如何为 swagger 2.8.0 做友好的基本 url

我正在尝试更改 API 文档的基本访问 url。网址为“http://localhost:8080/swagger-ui.html”。我想要得到类似“http://localhost:8080/myapi/swagger-ui.html”的内容。 我用

回答 5 投票 0

Spring Boot 应用程序中使用 JAX-RS 的 Swagger UI (SpringFox) - 无法加载 API 定义

我按照本指南在 Spring Boot 应用程序中启用带有 JAX-RS 的 Swagger UI:https://atechref.com/using-swagger-2-with-spring-boot-spring-fox-and-jax- rs-project/ 但我得到以下信息...

回答 1 投票 0

Springfox 2.8 或 3.0 在 Spring Boot 2.7 项目中工作

我们找不到让 Swagger 与我们的任何 Spring Boot 2.7 应用程序一起工作的方法。 我们已经尝试了在网络上可以找到的所有配置变体,但到目前为止还没有任何效果。以下是会议的示例...

回答 1 投票 0

向 Swagger UI 添加搜索/过滤器以过滤端点

我们已经将 swagger api 文档集成到 Spring Boot 中,现在使用 swagger-ui-react": "3.30.1" 来显示 SwaggerUI(默认 /api-docs)。有很多控制器/

回答 1 投票 0

如何将springdoc与@PostMapping(consumes = MediaType.APPLICATION_FORM_URLENCODED_VALUE)和@RequestParam一起使用

我正在将项目从 SpringFox 升级到 SpringDoc v1.6.12,我努力使新代码适用于我的 RestController 的以下方法: @PostMapping(路径 = TASK_MAPPING_PATH, 消耗 =

回答 1 投票 0

从 java 生成 Swagger UI,为 RequestBody 提供示例不起作用

如何在 Swagger UI 中提供请求正文的示例? 我使用 Springboot 作为框架。 这是重现该问题的最小java代码: 导入org.springframework.http。

回答 1 投票 0

将 Swagger Basic AUTH 添加到 Spring Boot 应用程序

要求: 使用 Springfox 的 Spring Boot 应用程序 向 Swagger 添加 BASIC 身份验证 传递所有其他请求 代码:已实施 @EnableWebSecurity @配置 公共类 SecurityConfig

回答 4 投票 0

spring boot 2.7.18:无法启动bean“documentationPluginsBootstrapper”

我正在尝试将 sprintboot 从 2.0.4 迁移到 2.7.18。我还将java版本从8更新到21。 io.springfox 依赖项为 2.8.0 io.spring...

回答 1 投票 0

“检测到不明确的搜索映射。” Spring Boot 2.3.6 中实现 springfox-boot-starter 3.0.0 时抛出异常

“java.lang.IllegalStateException:检测到不明确的搜索映射。”当我尝试在 Spring Boot 2.3.6 中实现 springfox-boot-starter 3.0.0 时抛出异常。 我有两个重载方法

回答 1 投票 0

如何在java 19 maven项目上将Swagger Ui添加到spring 3

我正在尝试将 Swagger-UI 添加到我的项目中,但由于错误而失败。 我读到,在最近的春季,@EnableSwagger2 是必需的,无论是否不起作用。 这是我的 pom.xml 我正在尝试将 Swagger-UI 添加到我的项目中,但由于错误而失败。 我读到,在最近的春季,@EnableSwagger2 是必需的,无论是否不起作用。 这是我的 pom.xml <?xml version="1.0" encoding="UTF-8"?> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> <parent> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-parent</artifactId> <version>3.0.3</version> <relativePath/> <!-- lookup parent from repository --> </parent> <groupId>com.kc6379</groupId> <artifactId>zarzadanie-magazynem</artifactId> <version>0.0.1-SNAPSHOT</version> <name>zarzadanie-magazynem</name> <description>zarzadanie-magazynem</description> <properties> <java.version>19</java.version> </properties> <dependencies> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-data-jpa</artifactId> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-data-rest</artifactId> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-mail</artifactId> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-security</artifactId> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-thymeleaf</artifactId> </dependency> <dependency> <groupId>org.thymeleaf.extras</groupId> <artifactId>thymeleaf-extras-springsecurity6</artifactId> </dependency> <dependency> <groupId>com.mysql</groupId> <artifactId>mysql-connector-j</artifactId> <scope>runtime</scope> </dependency> <dependency> <groupId>org.projectlombok</groupId> <artifactId>lombok</artifactId> <optional>true</optional> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-test</artifactId> <scope>test</scope> </dependency> <dependency> <groupId>org.springframework.security</groupId> <artifactId>spring-security-test</artifactId> <scope>test</scope> </dependency> <dependency> <groupId>javax.validation</groupId> <artifactId>validation-api</artifactId> <version>2.0.1.Final</version> </dependency> <dependency> <groupId>org.mapstruct</groupId> <artifactId>mapstruct</artifactId> <version>1.5.3.Final</version> </dependency> <dependency> <groupId>org.mapstruct</groupId> <artifactId>mapstruct-processor</artifactId> <version>1.5.3.Final</version> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-oauth2-resource-server</artifactId> <version>3.0.2</version> </dependency> <dependency> <groupId>io.jsonwebtoken</groupId> <artifactId>jjwt-jackson</artifactId> <version>0.11.5</version> </dependency> <dependency> <groupId>io.jsonwebtoken</groupId> <artifactId>jjwt-impl</artifactId> <version>0.11.5</version> </dependency> <dependency> <groupId>io.jsonwebtoken</groupId> <artifactId>jjwt-api</artifactId> <version>0.11.5</version> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-validation</artifactId> <version>3.0.2</version> </dependency> <dependency> <groupId>org.springdoc</groupId> <artifactId>springdoc-openapi-starter-webmvc-ui</artifactId> <version>2.0.2</version> </dependency> </dependencies> <build> <plugins> <plugin> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-maven-plugin</artifactId> <configuration> <excludes> <exclude> <groupId>org.projectlombok</groupId> <artifactId>lombok</artifactId> </exclude> </excludes> </configuration> </plugin> </plugins> </build> </project> 所以我使用了 spring boot-starter-validation 和 springdoc-openapi-starter-webmvc-ui,以及在 http://localhost:8080/swagger-ui/index.html 上调用 GET 时遇到的错误 浏览器错误: 在控制台中我收到此错误块: ERROR 1272 --- [nio-8080-exec-5] o.a.c.c.C.[.[.[/].[dispatcherServlet] : Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Request processing failed: java.lang.NullPointerException: Cannot invoke "org.springframework.data.repository.query.Param.value()" because the return value of "java.lang.reflect.Parameter.getAnnotation(java.lang.Class)" is null] with root cause java.lang.NullPointerException: Cannot invoke "org.springframework.data.repository.query.Param.value()" because the return value of "java.lang.reflect.Parameter.getAnnotation(java.lang.Class)" is null at org.springdoc.core.data.DataRestOperationService.getParameterType(DataRestOperationService.java:242) ~[springdoc-openapi-starter-common-2.0.2.jar:2.0.2] at org.springdoc.core.data.DataRestOperationService.buildSearchOperation(DataRestOperationService.java:209) ~[springdoc-openapi-starter-common-2.0.2.jar:2.0.2] at org.springdoc.core.data.DataRestOperationService.buildOperation(DataRestOperationService.java:136) ~[springdoc-openapi-starter-common-2.0.2.jar:2.0.2] at org.springdoc.core.data.DataRestRouterOperationService.buildRouterOperation(DataRestRouterOperationService.java:289) ~[springdoc-openapi-starter-common-2.0.2.jar:2.0.2] at org.springdoc.core.data.DataRestRouterOperationService.buildRouterOperation(DataRestRouterOperationService.java:228) ~[springdoc-openapi-starter-common-2.0.2.jar:2.0.2] at org.springdoc.core.data.DataRestRouterOperationService.buildRouterOperationList(DataRestRouterOperationService.java:194) ~[springdoc-openapi-starter-common-2.0.2.jar:2.0.2] at org.springdoc.core.data.DataRestRouterOperationService.buildSearchRouterOperationList(DataRestRouterOperationService.java:149) ~[springdoc-openapi-starter-common-2.0.2.jar:2.0.2] at org.springdoc.core.providers.SpringRepositoryRestResourceProvider.lambda$findSearchControllers$13(SpringRepositoryRestResourceProvider.java:383) ~[springdoc-openapi-starter-common-2.0.2.jar:2.0.2] at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:183) ~[na:na] at java.base/java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:179) ~[na:na] at java.base/java.util.HashMap$ValueSpliterator.forEachRemaining(HashMap.java:1787) ~[na:na] at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:509) ~[na:na] at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499) ~[na:na] at java.base/java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:150) ~[na:na] at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:173) ~[na:na] at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234) ~[na:na] at java.base/java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:596) ~[na:na] at org.springdoc.core.providers.SpringRepositoryRestResourceProvider.findSearchControllers(SpringRepositoryRestResourceProvider.java:383) ~[springdoc-openapi-starter-common-2.0.2.jar:2.0.2] at org.springdoc.core.providers.SpringRepositoryRestResourceProvider.findSearchResourceMappings(SpringRepositoryRestResourceProvider.java:362) ~[springdoc-openapi-starter-common-2.0.2.jar:2.0.2] at org.springdoc.core.providers.SpringRepositoryRestResourceProvider.getRouterOperations(SpringRepositoryRestResourceProvider.java:276) ~[springdoc-openapi-starter-common-2.0.2.jar:2.0.2] at org.springdoc.webmvc.api.OpenApiResource.lambda$getPaths$1(OpenApiResource.java:170) ~[springdoc-openapi-starter-webmvc-api-2.0.2.jar:2.0.2] at java.base/java.util.Optional.ifPresent(Optional.java:178) ~[na:na] at org.springdoc.webmvc.api.OpenApiResource.lambda$getPaths$2(OpenApiResource.java:169) ~[springdoc-openapi-starter-webmvc-api-2.0.2.jar:2.0.2] at java.base/java.util.Optional.ifPresent(Optional.java:178) ~[na:na] at org.springdoc.webmvc.api.OpenApiResource.getPaths(OpenApiResource.java:165) ~[springdoc-openapi-starter-webmvc-api-2.0.2.jar:2.0.2] at org.springdoc.api.AbstractOpenApiResource.getOpenApi(AbstractOpenApiResource.java:366) ~[springdoc-openapi-starter-common-2.0.2.jar:2.0.2] at org.springdoc.webmvc.api.OpenApiResource.openapiJson(OpenApiResource.java:140) ~[springdoc-openapi-starter-webmvc-api-2.0.2.jar:2.0.2] at org.springdoc.webmvc.api.OpenApiWebMvcResource.openapiJson(OpenApiWebMvcResource.java:117) ~[springdoc-openapi-starter-webmvc-api-2.0.2.jar:2.0.2] at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:104) ~[na:na] at java.base/java.lang.reflect.Method.invoke(Method.java:578) ~[na:na] at org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:207) ~[spring-web-6.0.5.jar:6.0.5] at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:152) ~[spring-web-6.0.5.jar:6.0.5] at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:117) ~[spring-webmvc-6.0.5.jar:6.0.5] at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:884) ~[spring-webmvc-6.0.5.jar:6.0.5] at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:797) ~[spring-webmvc-6.0.5.jar:6.0.5] at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:87) ~[spring-webmvc-6.0.5.jar:6.0.5] at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:1081) ~[spring-webmvc-6.0.5.jar:6.0.5] at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:974) ~[spring-webmvc-6.0.5.jar:6.0.5] at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:1011) ~[spring-webmvc-6.0.5.jar:6.0.5] at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:903) ~[spring-webmvc-6.0.5.jar:6.0.5] at jakarta.servlet.http.HttpServlet.service(HttpServlet.java:705) ~[tomcat-embed-core-10.1.5.jar:6.0] at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:885) ~[spring-webmvc-6.0.5.jar:6.0.5] at jakarta.servlet.http.HttpServlet.service(HttpServlet.java:814) ~[tomcat-embed-core-10.1.5.jar:6.0] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:223) ~[tomcat-embed-core-10.1.5.jar:10.1.5] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:158) ~[tomcat-embed-core-10.1.5.jar:10.1.5] at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53) ~[tomcat-embed-websocket-10.1.5.jar:10.1.5] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:185) ~[tomcat-embed-core-10.1.5.jar:10.1.5] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:158) ~[tomcat-embed-core-10.1.5.jar:10.1.5] at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:110) ~[spring-web-6.0.5.jar:6.0.5] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:185) ~[tomcat-embed-core-10.1.5.jar:10.1.5] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:158) ~[tomcat-embed-core-10.1.5.jar:10.1.5] at org.springframework.web.servlet.resource.ResourceUrlEncodingFilter.doFilter(ResourceUrlEncodingFilter.java:66) ~[spring-webmvc-6.0.5.jar:6.0.5] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:185) ~[tomcat-embed-core-10.1.5.jar:10.1.5] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:158) ~[tomcat-embed-core-10.1.5.jar:10.1.5] at org.springframework.security.web.FilterChainProxy.lambda$doFilterInternal$3(FilterChainProxy.java:231) ~[spring-security-web-6.0.2.jar:6.0.2] at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:365) ~[spring-security-web-6.0.2.jar:6.0.2] at org.springframework.security.web.access.intercept.AuthorizationFilter.doFilter(AuthorizationFilter.java:100) ~[spring-security-web-6.0.2.jar:6.0.2] at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:374) ~[spring-security-web-6.0.2.jar:6.0.2] at org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:126) ~[spring-security-web-6.0.2.jar:6.0.2] at org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:120) ~[spring-security-web-6.0.2.jar:6.0.2] at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:374) ~[spring-security-web-6.0.2.jar:6.0.2] at org.springframework.security.web.session.SessionManagementFilter.doFilter(SessionManagementFilter.java:131) ~[spring-security-web-6.0.2.jar:6.0.2] at org.springframework.security.web.session.SessionManagementFilter.doFilter(SessionManagementFilter.java:85) ~[spring-security-web-6.0.2.jar:6.0.2] at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:374) ~[spring-security-web-6.0.2.jar:6.0.2] at org.springframework.security.web.authentication.AnonymousAuthenticationFilter.doFilter(AnonymousAuthenticationFilter.java:100) ~[spring-security-web-6.0.2.jar:6.0.2] at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:374) ~[spring-security-web-6.0.2.jar:6.0.2] at org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter.doFilter(SecurityContextHolderAwareRequestFilter.java:179) ~[spring-security-web-6.0.2.jar:6.0.2] at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:374) ~[spring-security-web-6.0.2.jar:6.0.2] at org.springframework.security.web.savedrequest.RequestCacheAwareFilter.doFilter(RequestCacheAwareFilter.java:63) ~[spring-security-web-6.0.2.jar:6.0.2] at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:374) ~[spring-security-web-6.0.2.jar:6.0.2] at com.kc6379.zarzadaniemagazynem.security.JwtAuthenticationFilter.doFilterInternal(JwtAuthenticationFilter.java:35) ~[classes/:na] at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:116) ~[spring-web-6.0.5.jar:6.0.5] at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:374) ~[spring-security-web-6.0.2.jar:6.0.2] at org.springframework.security.web.authentication.logout.LogoutFilter.doFilter(LogoutFilter.java:107) ~[spring-security-web-6.0.2.jar:6.0.2] at org.springframework.security.web.authentication.logout.LogoutFilter.doFilter(LogoutFilter.java:93) ~[spring-security-web-6.0.2.jar:6.0.2] at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:374) ~[spring-security-web-6.0.2.jar:6.0.2] at org.springframework.security.web.header.HeaderWriterFilter.doHeadersAfter(HeaderWriterFilter.java:90) ~[spring-security-web-6.0.2.jar:6.0.2] at org.springframework.security.web.header.HeaderWriterFilter.doFilterInternal(HeaderWriterFilter.java:75) ~[spring-security-web-6.0.2.jar:6.0.2] at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:116) ~[spring-web-6.0.5.jar:6.0.5] at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:374) ~[spring-security-web-6.0.2.jar:6.0.2] at org.springframework.security.web.context.SecurityContextHolderFilter.doFilter(SecurityContextHolderFilter.java:82) ~[spring-security-web-6.0.2.jar:6.0.2] at org.springframework.security.web.context.SecurityContextHolderFilter.doFilter(SecurityContextHolderFilter.java:69) ~[spring-security-web-6.0.2.jar:6.0.2] at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:374) ~[spring-security-web-6.0.2.jar:6.0.2] at org.springframework.security.web.context.request.async.WebAsyncManagerIntegrationFilter.doFilterInternal(WebAsyncManagerIntegrationFilter.java:62) ~[spring-security-web-6.0.2.jar:6.0.2] at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:116) ~[spring-web-6.0.5.jar:6.0.5] at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:374) ~[spring-security-web-6.0.2.jar:6.0.2] at org.springframework.security.web.session.DisableEncodeUrlFilter.doFilterInternal(DisableEncodeUrlFilter.java:42) ~[spring-security-web-6.0.2.jar:6.0.2] at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:116) ~[spring-web-6.0.5.jar:6.0.5] at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:374) ~[spring-security-web-6.0.2.jar:6.0.2] at org.springframework.security.web.FilterChainProxy.doFilterInternal(FilterChainProxy.java:233) ~[spring-security-web-6.0.2.jar:6.0.2] at org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:191) ~[spring-security-web-6.0.2.jar:6.0.2] 非常感谢您的支持。 我已经尝试了互联网上的一些指南来让 Swagger-UI 工作,但我不断收到错误。 spring-boot-starter-validation必须是相同的版本。基本上,您需要删除版本标签。 但是我对 spring-boot-starter-parent 3.0.3 版还有另一个问题。它不会生成 openapi json,响应永远处于待处理状态。不过它可以与 3.0.2 一起使用。 我的 pom 中只有 swagger ui 的依赖: <dependency> <groupId>org.springdoc</groupId> <artifactId>springdoc-openapi-starter-webmvc-ui</artifactId> </dependency> 我有一个适用于 Spring Boot 3 的不同配置。 我的依赖项是: <dependency> <groupId>io.springfox</groupId> <artifactId>springfox-boot-starter</artifactId> <version>3.0.0</version> </dependency> <dependency> <groupId>io.springfox</groupId> <artifactId>springfox-swagger-ui</artifactId> <version>2.9.2</version> </dependency> 并在我添加的 Spring Boot 配置类中 @Bean public Docket api() { return new Docket(DocumentationType.SWAGGER_2) .select() .apis(RequestHandlerSelectors.any()) .paths(PathSelectors.any()) .build(); } 也许这会有帮助。

回答 3 投票 0

Hybris swagger UI 日期时间示例格式

我有一个 Hybris 项目,我们通过 swagger + swagger-ui 提供一个宁静的 API。我们遇到日期时间属性和参数的格式问题。它以这种格式显示:“

回答 2 投票 0

Swagger url 生成的 json 缺少“securityschemes”组件

我生成的 swagger.json 缺少 securitySchemes 组件。当我复制 url json 并将其粘贴到 swagger 编辑器中时,我得到 - 在此输入图像描述 swagger.json 中生成的 yaml ...

回答 2 投票 0

如何使用 Swagger 注释订购 API 端点 (Springfox)

我希望用 @ApiOperation 标记的控制器端点在 Swagger 规范中按特定顺序出现。尝试像这样在 @ApiOperation 上设置位置: @ApiOperation(值 = "xxx", 位置 = 1...

回答 1 投票 0

swagger @ApiModelProperty List<String> 属性的示例值

我有一个类,其中有一个属性是List 公共类我的类{ .... @ApiModelProperty(位置= 2) 私有列表 产品标识符; ...

回答 10 投票 0

© www.soinside.com 2019 - 2024. All rights reserved.