部署 Spring Boot 应用程序时 Swagger UI 错误验证

编程入门 行业动态 更新时间:2024-10-12 03:23:16
本文介绍了部署 Spring Boot 应用程序时 Swagger UI 错误验证的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

Swagger-ui.html 由于验证在页面底部显示错误

Swagger-ui.html shows a error at the bottom of the page due to validation

`{"schemaValidationMessages":[{"level":"error","message":"Can't read from file www.example/v2/api-docs"}]}`

我对此进行了一些研究,并了解到我们需要关闭验证以消除错误.但是如何从 Spring Boot 应用程序中关闭它.?或者有什么方法可以在 Spring Boot 应用程序中编辑 swagger-ui.html?

I did some research on it and came to know that we need to turn off the validations to remove the error. but how to turn it off from spring boot application.? or is there any way to edit the swagger-ui.html in a spring boot app ?

推荐答案

我通过添加以下代码禁用验证解决了这个问题

I solved it by disabling the validation by adding the following code

`@Bean public UiConfiguration getConfig(){ String validatorUrl = "validatorUrl"; return new UiConfiguration(validatorUrl); }`

更多推荐

部署 Spring Boot 应用程序时 Swagger UI 错误验证

本文发布于:2023-10-28 10:57:47,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1536440.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:应用程序   错误   Boot   Spring   Swagger

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!