swagger-api / swagger-api/swagger-codegen

Generated code includes "OpenAPI spec version: 1.0.0" - is this a lie?

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

Many (all?) the generated code says "OpenAPI spec version: 1.0.0" in a comment right at the top of each file:
https://github.com/swagger-api/swagger-codegen/search?q=OpenAPI+spec+version+1.0.0&unscoped_q=OpenAPI+spec+version+1.0.0

Is this correct? I've been generating clients from an OpenAPI v2 spec, but they're still getting this "OpenAPI spec version: 1.0.0" in the header comment in every generated file. Since this is confusing, can anyone please clarify what's going on? Is it just a matter of the templates hardcoding the wrong string here?

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 by searching the repository for the "OpenAPI spec version: 1.0.0" string using the linked search results and inspect the templates that emit it. Determine whether the header reflects the input specification version, then verify generated files no longer contain a misleading version when using an OpenAPI v2 spec.

Written by the indexing model from the issue text.

Assessment

Tech stack
openapi
Domain
api, 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.