swagger-api / swagger-api/swagger-codegen

[Golang] Could not generate api file for 'Beacon'

Open
#11,157 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
Exception in thread "Thread-1" java.lang.RuntimeException: Could not generate api file for 'Beacon'
        at io.swagger.codegen.v3.DefaultGenerator.generateApis(DefaultGenerator.java:579)
        at io.swagger.codegen.v3.DefaultGenerator.generate(DefaultGenerator.java:782)
        at io.swagger.codegen.v3.cli.cmd.Generate.run(Generate.java:369)
        at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.NullPointerException
        at java.util.TreeMap.put(TreeMap.java:563)
        at java.util.TreeSet.add(TreeSet.java:255)
        at java.util.AbstractCollection.addAll(AbstractCollection.java:344)
        at java.util.TreeSet.addAll(TreeSet.java:312)
        at io.swagger.codegen.v3.DefaultGenerator.processOperations(DefaultGenerator.java:968)
        at io.swagger.codegen.v3.DefaultGenerator.generateApis(DefaultGenerator.java:494)
        ... 3 more

Swagger-codegen version

Tried latest unstable, 3.0.27, 3.0.26, 3.0.20. None of these work.

Swagger declaration file content or url

https://github.com/ethereum/eth2.0-APIs/releases/download/v2.0.0/beacon-node-oapi.json

Command line used for generation
swagger-codegen generate -i https://github.com/ethereum/eth2.0-APIs/releases/download/v2.0.0/beacon-node-oapi.json -l go -o /local/out/go

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 failure with the provided beacon-node-oapi.json URL and command line, then inspect DefaultGenerator.processOperations and DefaultGenerator.generateApis where the stack trace points. Identify the null value that reaches the TreeSet and verify that Go API generation completes successfully for this declaration.

Written by the indexing model from the issue text.

Assessment

Tech stack
go, java
Domain
api, tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.