swagger-api / swagger-api/swagger-codegen

Swagger codegen automatically creates examples

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

Generating Swagger JSON from YAML produces examples automatically. Not all tools - in particular AWS API Gateway accept this.

We are generating JSON Swagger from YAML, by using lang equal to swagger.

Swagger-codegen version

v2.3.1

Suggest a fix/enhancement

The code generator appears to automatically generate Swagger examples when converting YAML to JSON. This is not always desirable. It might make sense to provide a configuration to disable automatic example generation.

If this already exists, then the documentation should support this since I was unable to find any documentation on the matter.

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

No file or test is named. Start by tracing the swagger-codegen v2.3.1 path for lang=swagger that converts YAML to JSON, and check whether an option already controls generated examples. Done means documenting an existing option or providing configuration that suppresses examples, with generated JSON suitable for AWS API Gateway.

Written by the indexing model from the issue text.

Assessment

Tech stack
openapi
Domain
api, tooling
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 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.