swagger-api / swagger-api/swagger-codegen

[JAVA] generating swagger java cient api for Matrix synapse client-server doesnt compile

Open
#9,049 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

Hii
Tried to use https://github.com/swagger-api/swagger-codegen

I tried the master version and 2.4.0 version and 2.3.0 version.

 java -jar /usr/local/lib/java/swagger-codegen-cli.jar generate -i  https://matrix.org/docs/api/client-server/json/api-docs.json -l java

and then tried to compile the project using gradle build.

the generated API doesn't compile, it has stuff like this:

@ApiModel(description = "The push rule.")
@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaClientCodegen", date = "2019-01-06T21:52:34.611+02:00")
public class InlineResponse20026 {
  @SerializedName("actions")
  private  actions = ;

  @SerializedName("conditions")
  private List<Object> conditions = null;

It's possible that codegen could be broken.

related issue https://github.com/swagger-api/swagger-codegen/issues/5276#issue-218674758

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

Reproduce the report with the shown swagger-codegen CLI command, the Matrix client-server api-docs.json input, and the Java generator. Inspect the generated InlineResponse20026 class and run Gradle build; done means the generated Java project compiles without invalid declarations such as the reported actions field.

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
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.