swagger-api / swagger-api/swagger-codegen

[go-server] Generated file api/swagger.yaml is empty when OpenAPI spec 3.0.n is used

Open
#10,131 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

Tried generating go-server as shown below

java -jar swagger-codegen-cli.jar generate --lang go-server --input-spec build/yaml/openconfig-lldp.yaml --template-dir tools/swagger_codegen/go-server/templates-yang --output ./temp/ -version

The Generated file api/swagger.yaml is empty when OpenAPI spec 3.0.n is used (i had 3.0.1)

Looks like {{{swagger-yaml}}} is not getting content in swagger.mustache file

Swagger-codegen version

3.0.18

Command line used for generation

java -jar swagger-codegen-cli.jar generate --lang go-server --input-spec build/yaml/openconfig-lldp.yaml --template-dir tools/swagger_codegen/go-server/templates-yang --output ./temp/ -version

Steps to reproduce
Related issues/PRs
Suggest a fix/enhancement

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 tools/swagger_codegen/go-server/templates-yang/swagger.mustache and reproduce the issue using the supplied command and build/yaml/openconfig-lldp.yaml. Compare the generated api/swagger.yaml for OpenAPI 3.0.1 with the template input; it is done when the generated file contains the expected OpenAPI content.

Written by the indexing model from the issue text.

Assessment

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