swagger-api / swagger-api/swagger-codegen
[qt] Improve validation
Nobody has claimed this yet.
- Dominant language
- Mustache
- Stars
- 17.8k
- Forks
- 6k
- PR merge metrics
- No merged PRs in 30d
Description
Description
Validation is missing in Qt client.
Swagger-codegen version
HEAD
Swagger declaration file content or url
Command line used for generation
$ swagger-codegen generate -i ../api.yml -l qt5cpp
Steps to reproduce
- Generate client
- Instance Pet object without setting the name
- See neither compilation nor execution error
Related issues/PRs
I discovered this issue after raising #7802
Suggest a fix/enhancement
A first step would be to add required parameter to the model constructor.
A second step would be to avoid property setter with pointer and add unsetter for optionnal field.
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 petstore.yaml declaration and generate the qt5cpp client using the command shown. Inspect the generated Pet model and its handling of the required name field, then compare behavior for required and optional properties. Done means required fields are enforced at construction and optional fields support the requested setter and unsetter behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- api
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100