【问题标题】:Is there a way to convert an OpenAPI specification to a spring cloud contract?有没有办法将 OpenAPI 规范转换为 Spring Cloud 合约?
【发布时间】:2019-11-21 04:29:37
【问题描述】:

我正在尝试将 openAPI 规范(用 yaml 编写)转换为 Spring Cloud 合约 YAML DSL。有没有可以做这种转换的插件?

【问题讨论】:

    标签: spring-boot yaml spring-cloud openapi spring-cloud-contract


    【解决方案1】:

    是的,你可以。请阅读这篇博文,了解如何将 yaml 合约纳入 openapi 规范 https://springframework.guru/defining-spring-cloud-contracts-in-open-api/

    【讨论】:

    • SCC OA3 转换器将 Spring 云合约 YAML DSL 结合到 OA3 扩展中。我所需要的只是将任何 Open API 规范转换为 DSL 合约
    • 在你的openapi中添加section来添加合约就足够了
    • 在 openapi 部分添加合约后,它是否与 openapi-generator-maven-plugin 一起使用?
    • 据我了解,它只是为 OpenAPI 定义提供了一个扩展,因此它可以与任何与 openapi 兼容的插件一起使用。
    猜你喜欢
    • 2021-02-16
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-02-15
    • 2014-11-06
    • 2017-03-25
    • 2021-09-01
    • 2021-05-15
    相关资源
    最近更新 更多