swagger-api / swagger-api/swagger-codegen
[PHP] minimum/maximum not reflected
Nobody has claimed this yet.
- Dominant language
- Mustache
- Stars
- 17.8k
- Forks
- 6k
- PR merge metrics
- No merged PRs in 30d
Description
Description
minimum and maximum values on properties do not get reflected to the PHP classes.
Swagger-codegen version
Docker CLI container
docker run --rm -v ${PWD}:/local swaggerapi/swagger-codegen-cli-v3 generate \
-i /local/out/quantities.yml \
-l php \
--api-package Quantities \
-o /local/out/quantities
Swagger declaration file content or url
https://swagger.io/docs/specification/data-models/inheritance-and-polymorphism/
properties:
quantity:
type: integer
minimum: 100
maximum: 600
The output does not reflect any >= 100 <= 600 comparison.
When type = string and instead of minimum/maximum we add enum with some values, there is getting a lot of stuff into the PHP classes (with a method getQuantityAllowableValues() on the model). There is no such thing with integer and minimum/maximum.
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
Reproduce the issue with the shown Docker CLI command, using the quantities.yml declaration and PHP output. Compare the generated model for quantity with the minimum: 100 and maximum: 600 constraints; done means the generated PHP classes reflect those bounds similarly to enum values.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- docker, openapi, php
- Domain
- api, devtools
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100