swagger-api / swagger-api/swagger-codegen

[swagger, all] enum data for integer parameters are not put into operations data

Open
#6,047 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

I can't reopen the issue #3964 so I post a new issue.

Description

There are 2 problems:

  1. Proper descriptions for integer enum parameters are not present with -l swagger for array items. As seen from gist, integerEnum parameter is properly dumped, but integerArrayEnum does not contain enum in items.
  2. Proper descriptions for integer enum parameters are not present in -DdebugOperations. As seen from gist, "isEnum" : true and allowableValues are only present for string parameters.
Swagger-codegen version

Current master (2.2.3-SNAPSHOT)

Swagger declaration file content or url

Source JSON: https://gist.github.com/checat/1d9b014e39e9767cf30ba401d2cf18c4#file-source-json

Result JSON: https://gist.github.com/checat/1d9b014e39e9767cf30ba401d2cf18c4#file-swagger-json

debugOperations.json https://gist.github.com/checat/1d9b014e39e9767cf30ba401d2cf18c4#file-debugoperations-json

Command line used for generation

java -DdebugOperations -jar swagger-codegen-cli.jar generate -i source.json -l swagger -o out-swagger >debugOperations.json

Steps to reproduce

Generate and see the problems in the description.

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 the Java CLI generation path invoked by swagger-codegen-cli.jar, using the linked source JSON and the -l swagger command. Compare the generated Swagger JSON and debugOperations.json with the described results; done means integer enum metadata appears for array items and in debug operations, not only for string parameters.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.