build.gradle - openApiGenerate 不生成模型
问题描述
我使用 gradle 插件
id "org.openapi.generator" version "5.1.1"
和 gradle.plugin 中的任务
openApiGenerate {
generatorName = "kotlin"
inputSpec = "$rootDir/src/main/resources/META-INF/resources/API.v1.yaml".toString()
outputDir = "$rootDir/generated".toString()
apiPackage = "org.openapi.example.api"
invokerPackage = "org.openapi.example.invoker"
modelPackage = "org.openapi.example.model"
configOptions = [
dateLibrary: "java8"
]
}
当我调用gradlew openApiGenerate
我有
Execution failed for task ':openApiGenerate'.
> There were issues with the specification. The option can be disabled via validateSpec (Maven/Gradle) or --skip-validate-spec (CLI).
| Error count: 244, Warning count: 0
Errors:
-attribute paths.'/v1/pet/{name}/home/'(post).responses.406.content is unexpected
-attribute paths.'/v1/pet/{name}/home'(post).responses.400.content is unexpected
..........
但是如果我在 CLI 版本中调用我的 yaml 生成模型和 API
为什么它称之为异常?
不幸的是,我什至无法在此处添加我的 yaml 的一部分,因为网站告诉我“看起来你添加了很多代码”
如果我添加
skipValidateSpec = true
我只得到没有模型的 API。为什么?
解决方案
推荐阅读
- c# - Linq 中 Yes/No 列中 Yes 的百分比
- coq - 如何应用公理来简化 Coq 中的匹配?
- javascript - 如何清除应用背景颜色的 div 元素的 javascript 生成网格
- python - Python - 直接来自教科书的代码错误 - 神经网络
- python - 如何让 Pillog.Image.alpha_composite 快速燃烧?或任何其他合并png的解决方案
- azure - 如何阻止 NSG 以外的 Azure 中同一子网中的 VM 之间的流量
- python - JIT-ted函数中矩阵元素的条件化
- python - Matplotlib Barh 过渡平滑
- javascript - 无法将项目添加到数组中反应原生
- jquery - jquery sort 函数将项目排序为字符串而不是数字