swagger-api / swagger-api/swagger-codegen
[C++] [pistache] Optional integer query parameter is not supported
Nobody has claimed this yet.
- Dominant language
- Mustache
- Stars
- 17.8k
- Forks
- 6k
- PR merge metrics
- No merged PRs in 30d
Description
Description
When I want to use an optional query-parameter as an integer, the generated code uses an pistache::Optionalstd::string instead of a pistache::Optional
Swagger-codegen version
2.4_master
Swagger declaration file content or url
parameters:
maxParam:
name: _max
in: query
description: Limits the number of returned results
required: false
type: integer
default: 10
Command line used for generation
java -DdebugModels=true -jar ../swagger-codegen/modules/swagger-codegen-cli/target/swagger-codegen-cli.jar generate -v -i swagger.yaml -l pistache-server -o server
Suggest a fix/enhancement
See pull request
https://github.com/swagger-api/swagger-codegen/pull/7816
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the supplied Swagger YAML declaration and run the documented swagger-codegen CLI command for the pistache-server generator. Compare the generated type for the optional integer query parameter with pull request 7816; done means the generated code uses pistache::Optional rather than pistache::Optionalstd::string.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- backend-api-design, tooling
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100