Muitilile error during generation openapi client from swagger

未关闭
#6,455 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
42/100
Issue 类型
缺陷
描述清晰度
基本清楚
活跃度
冷清
技术栈
java, openapi
领域
api

调研方向

解压 test-github-api.zip,进入 test-github-api 目录并运行 mvn clean install,以复现生成客户端的编译错误。检查生成的 RepositoryCreatedAt.java、RepositoryPushedAt.java、JSON.java 和 budget 模型文件,以及生成它们的 OpenAPI schema。报告的生成 Java 源文件能够在没有缺少方法和 ContentDirectory 类错误的情况下编译,即表示完成。

由索引模型根据 Issue 内容生成。

描述

feature

Hi
I am generating client using openapi toolkit base on your swagger schema. I and during compilation getting multiple errors

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.11.0:compile (default-compile) on project test-github-api: Compilation failure: Compilation failure:
[ERROR] /Users/arseniy/MyPrj/git/test-github-api/target/generated-sources/openapi/src/gen/java/main/api/github/com/generated/model/RepositoryCreatedAt.java:[118,39] cannot find symbol
[ERROR] symbol: method validateJsonElement(com.google.gson.JsonElement)
[ERROR] location: class java.time.OffsetDateTime
[ERROR] /Users/arseniy/MyPrj/git/test-github-api/target/generated-sources/openapi/src/gen/java/main/api/github/com/generated/model/RepositoryCreatedAt.java:[242,27] cannot find symbol
[ERROR] symbol: method validateJsonElement(com.google.gson.JsonElement)
[ERROR] location: class java.time.OffsetDateTime
[ERROR] /Users/arseniy/MyPrj/git/test-github-api/target/generated-sources/openapi/src/gen/java/main/api/github/com/generated/model/RepositoryPushedAt.java:[118,39] cannot find symbol
[ERROR] symbol: method validateJsonElement(com.google.gson.JsonElement)
[ERROR] location: class java.time.OffsetDateTime
[ERROR] /Users/arseniy/MyPrj/git/test-github-api/target/generated-sources/openapi/src/gen/java/main/api/github/com/generated/model/RepositoryPushedAt.java:[247,27] cannot find symbol
[ERROR] symbol: method validateJsonElement(com.google.gson.JsonElement)
[ERROR] location: class java.time.OffsetDateTime
[ERROR] /Users/arseniy/MyPrj/git/test-github-api/target/generated-sources/openapi/src/gen/java/main/api/github/com/generated/JSON.java:[79,94] cannot find symbol
[ERROR] symbol: class ContentDirectory
[ERROR] location: package api.github.com.generated.model
[ERROR] /Users/arseniy/MyPrj/git/test-github-api/target/generated-sources/openapi/src/gen/java/main/api/github/com/generated/model/BillingUpdateBudgetOrg200ResponseBudget.java:[461,15] cannot find symbol
[ERROR] symbol: method validateJsonElement(com.google.gson.JsonElement)
[ERROR] location: class java.lang.String
[ERROR] /Users/arseniy/MyPrj/git/test-github-api/target/generated-sources/openapi/src/gen/java/main/api/github/com/generated/model/Budget.java:[397,13] cannot find symbol
[ERROR] symbol: method validateJsonElement(com.google.gson.JsonElement)
[ERROR] location: class java.lang.String
[ERROR] /Users/arseniy/MyPrj/git/test-github-api/target/generated-sources/openapi/src/gen/java/main/api/github/com/generated/model/GetBudget.java:[464,13] cannot find symbol
[ERROR] symbol: method validateJsonElement(com.google.gson.JsonElement)
[ERROR] location: class java.lang.String
[ERROR] /Users/arseniy/MyPrj/git/test-github-api/target/generated-sources/openapi/src/gen/java/main/api/github/com/generated/model/BillingUpdateBudgetOrgRequest.java:[432,15] cannot find symbol
[ERROR] symbol: method validateJsonElement(com.google.gson.JsonElement)
[ERROR] location: class java.lang.String
[ERROR] -> [Help 1]

How to reproduce:

  1. open zip file test-github-api.zip
  2. cd test-github-api
  3. mvn clean install

Thanks
Arseniy Isakov

test-github-api.zip

主要语言
没有语言数据
星标
1.6k
派生
342
平均合并
3 小时 33 分钟
30 天内合并 PR
51

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

github/rest-api-description 的其他 Issue

查看 github/rest-api-description 的全部 Issue

相似的 Issue

更多 Backend & API Design Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。