【发布时间】:2020-11-10 07:57:35
【问题描述】:
我是 Spring Boot 和 YAML 的新手。
如何使用 Spring Boot 读取 YAML 文件,然后在 localhost 中显示结果?
类似于editor.swagger.io,但它是读取文件而不是编写代码?
【问题讨论】:
标签: java spring-boot yaml swagger-ui swagger-editor
我是 Spring Boot 和 YAML 的新手。
如何使用 Spring Boot 读取 YAML 文件,然后在 localhost 中显示结果?
类似于editor.swagger.io,但它是读取文件而不是编写代码?
【问题讨论】:
标签: java spring-boot yaml swagger-ui swagger-editor
您可以使用 Jackson 将 YAML 映射到 Java 对象。
对于 Spring Boot,使用 / GET 映射创建一个控制器并返回您的 html(或将 Spring MVC 与模板一起使用)。
这些资源可能有用:
【讨论】: