有没有人可以分享一些关于如何使用ReDoc和SpringBoot框架来实现API文档的例子?如果有人知道ReDoc + Springboot的一些很好的例子,那将是非常有帮助的。
发布于 2021-10-18 16:02:12
您可以创建一个启用springdoc-openapi-ui1的spring引导应用程序,然后添加一个静态html2,如here!将spec-url更改为http://localhost:8080/v3/api-docs 3
1:https://www.baeldung.com/spring-rest-openapi-documentation
2:https://stackoverflow.com/a/42393332/878710
3:
<!DOCTYPE html>
<html>
<head>
<title>Redoc</title>
<!-- needed for adaptive design -->
<meta charset="utf-8"/>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link href="https://fonts.googleapis.com/css?family=Montserrat:300,400,700|Roboto:300,400,700" rel="stylesheet">
<!--
Redoc doesn't change outer page styles
-->
<style>
body {
margin: 0;
padding: 0;
}
</style>
</head>
<body>
<redoc spec-url='http://localhost:8080/v3/api-docs'></redoc>
<script src="https://cdn.jsdelivr.net/npm/redoc@latest/bundles/redoc.standalone.js"> </script>
</body>
</html>https://stackoverflow.com/questions/67304585
复制相似问题