swagger-api / swagger-api/swagger-codegen

Go code doesn't compile

Open
#8,707 1 comment 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

we have a large API defined in swagger that I cannot post here.
I'm seeing two things:

  1. const variables are being redeclared all over the place, causing compile errors
  2. things marked as 'depreciated' are somehow getting duplicated, causing compile errors...

are there any flags/tweaks I can use to stop these things from happening? I was hoping that the code generated by the generator would just compile, without having to manually edit the generated sources .. is that an unreasonable expectation?

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

The issue does not name any generator files, tests, or entry points, and the Swagger API cannot be shared. Start by reviewing the Swagger definition, generator configuration, and generated Go sources to reproduce the constant redeclarations and duplicated deprecated items. Done means the generated Go code compiles without manual edits.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.