【问题标题】:Is there a way to configure openapi-generator to use jakarta package during generation有没有办法配置 openapi-generator 在生成期间使用 jakarta 包
【发布时间】:2022-12-19 19:55:10
【问题描述】:

我最近升级了我的项目以使用 spring-boot 3.0.0。所以我的项目中不再有 javax.* 模块了。但是 open-API 生成器一直在尝试导入 javax 模块。特别是,它使用了 javax.annotation.Generated 和 @Generated 注释,这些注释不再出现在项目中。有没有办法以某种方式重新配置它?

【问题讨论】:

    标签: java openapi-generator openapi-generator-maven-plugin


    【解决方案1】:

    是的,您可以在生成器的配置选项中使用 useSpringBoot3: "true"。 渐变中的示例:

            configOptions = [
                useSpringBoot3: "true"
            ]
    

    【讨论】:

    【解决方案2】:

    我也使用了以下内容:

        configOptions = [
            useSpringBoot3: "true"
        ]
    

    我听说在其他地方它应该是较新版本的 openapi 生成器的默认设置 - 但在我的情况下它不是,我不得不以这种方式强制它工作。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2022-07-23
      • 2022-01-21
      • 2021-08-08
      • 2022-10-13
      • 1970-01-01
      • 2022-08-05
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多