DoclerLabs / api-client-generator

API client generator is a console application capable of generating an API client based on OpenAPI(Swagger) specification.
MIT License
34 stars 19 forks source link

MinimumConstraint only supports int #39

Closed guilhermednt closed 3 years ago

guilhermednt commented 3 years ago

The following definition

discount:
  type: number
  format: float
  minimum: 0.0
  maximum: 99.99
  example: 25.5

Causes the generation to fail because the constraint doesn't support float:

https://github.com/DoclerLabs/api-client-generator/blob/b8b0ed56a2e863716722a1d85dd7cf22f9495ab1/src/Entity/Constraint/MinimumConstraint.php#L16

However the spec supports it: https://swagger.io/docs/specification/data-models/data-types/#numbers

The same should happen with maximum:

https://github.com/DoclerLabs/api-client-generator/blob/b8b0ed56a2e863716722a1d85dd7cf22f9495ab1/src/Entity/Constraint/MaximumConstraint.php#L16