swagger-api / swagger-api/swagger-codegen

[JAVA] Invalid java code is generated

Open
#8,945 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Mustache
Stars
17.8k
Forks
6k
PR merge metrics
No merged PRs in 30d

Description

Description

I'm trying to generate the API based on the fido2-server.yaml. The generated java code is invalid.
Due to the environment restriction I have to use swagger v2.0. Any idea's how to solve this?

Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.0:compile (default-compile) on project fido2.swagger: Compilation failure: Compilation failure:
/c:/dev/prj/hanndecl/fido2-swagger/target/generated-sources/openapi-server/src/main/java/io/swagger/api/AssertionApi.java:[74,204] <identifier> expected
/c:/dev/prj/hanndecl/fido2-swagger/target/generated-sources/openapi-server/src/main/java/io/swagger/api/AttestationApi.java:[74,206] <identifier> expected
Swagger-codegen version
<groupId>io.swagger</groupId>
<artifactId>swagger-codegen-maven-plugin</artifactId>
<version>2.3.1</version>
Swagger declaration file content or url

Maven project: https://github.com/hanndecl/fido2-swagger

Command line used for generation

see https://github.com/hanndecl/fido2-swagger/pom.xml

Steps to reproduce

{code}
maven clean install
{code}

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the Maven configuration in the linked fido2-swagger project's pom.xml and run the reported maven clean install reproduction. Inspect the generated AssertionApi.java and AttestationApi.java files at the reported compiler locations. Done means the generated Java sources compile successfully under swagger-codegen 2.3.1.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.