【问题标题】:How to read yaml file then display the result in localhost by using springboot?如何使用spring boot读取yaml文件然后在localhost中显示结果?
【发布时间】:2020-11-10 07:57:35
【问题描述】:

我是 Spring Boot 和 YAML 的新手。

如何使用 Spring Boot 读取 YAML 文件,然后在 localhost 中显示结果?

类似于editor.swagger.io,但它是读取文件而不是编写代码?

【问题讨论】:

    标签: java spring-boot yaml swagger-ui swagger-editor


    【解决方案1】:

    您可以使用 Jackson 将 YAML 映射到 Java 对象。 对于 Spring Boot,使用 / GET 映射创建一个控制器并返回您的 html(或将 Spring MVC 与模板一起使用)。

    这些资源可能有用:

    【讨论】:

      猜你喜欢
      • 2019-01-18
      • 2014-03-16
      • 2018-10-27
      • 1970-01-01
      • 2018-11-29
      • 1970-01-01
      • 2021-07-21
      • 1970-01-01
      • 2023-03-18
      相关资源
      最近更新 更多