【问题标题】:Does spring boot 2.1.x support yaml 1.2 specificationspring boot 2.1.x 是否支持 yaml 1.2 规范
【发布时间】:2019-10-26 17:39:45
【问题描述】:

spring boot 2.1.x 是否支持 yaml 1.2 规范?

如果没有,是否可以使用 yaml 1.2 +snakeyaml-engine 来支持 spring boot application.yml ?

【问题讨论】:

  • 我没有找到对版本号的明确引用,但由于他们在 documentation 中使用扩展名 .yml 并且 officially recommended extension 自 2006 年以来一直是 .yaml,因此他们不太可能支持 2009 年的 YAML 1.2 规范

标签: spring-boot yaml snakeyaml


【解决方案1】:

Spring Boot 使用snakeyaml 1.23。

根据描述,这是 YAML 1.1

<description>YAML 1.1 parser and emitter for Java</description>

因为 Snakeyaml-engine 支持 YAML 而在snakeyaml 中不支持,所以 API 不兼容,因此您将无法在 Spring Boot 中使用它

【讨论】:

  • 最好将其放入文档中。因此,人们不会使用 YAML 1.2 的任何不兼容功能,就像十年前最近推出的一样。
  • Spring Boot 参考文档显示它使用 SnakeYaml,而 SnakeYaml 说它支持 1.1。但我不知道你为什么不使用 YAML 1.2 的原因。你应该问问 Spring Boot 团队
  • spring boot 2.x 使用版本 1.19 github.com/spring-projects/spring-boot/blob/2.0.x/…
  • @Paizo Spring Boot 2.0.x 使用 1.19 Spring Boot 2.1.x 使用 1.23
猜你喜欢
  • 2018-07-26
  • 1970-01-01
  • 2019-09-17
  • 1970-01-01
  • 1970-01-01
  • 2017-06-19
  • 1970-01-01
  • 2016-11-15
  • 1970-01-01
相关资源
最近更新 更多