-
Notifications
You must be signed in to change notification settings - Fork 20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Request DTO type Double #502
Comments
Do you get an error? What happens? |
I forgot the full line, sorry.
Only work with Integer or String. |
If i change to string or integer, works well, but i need the param to be a float or decimal. |
Odd behavior. What type of route is this? HTTP GET or HTTP POST/PUT/PATCH? |
Also, please post full stack trace. |
Its a HTTP POST. |
I figured you'd say HTTP POST. The code was never designed expecting an HTTP GET based DTO to be used on a POST route and as such is failing because there is no condition for that. Best practice is not to placing GET parameters on POST routes since you can just put everything in the POST body, but if you must my suggestion is just to use |
Actually that won't work either (most likely) because that too expects GET parameters to only be used on HTTP GET routes.... |
Sorry, if I didnt understood. So the plugin doenst generete an endpoint (post) on swagger with body where can be double/decimal? I already have the controller, the decimal works fine, but on swagger shows wrong (string or integer). |
If the route is HTTP POST, why not use |
I am using this example, dtoBodyExample: Who use this DTO: |
Changed to @swag\SwagRequestBody and @SwagDtoRequestBody( Same problem. |
post stack trace please. |
@swag\SwagRequestBody
|
Yeah that doesn't make a lot of sense, it's saying that the value getting passed into here: https://github.com/cnizzardini/cakephp-swagger-bake/blob/1.next/src/Lib/OpenApi/SchemaTrait.php#L45 is failing the type check... but |
At my api controller to reproduce:
Like i said works fine when i change to integer or string, but not if number. Anyway, thanks for your time. |
And my routes.php
|
Remove the Won't be releasing that, just gonna merge it in so there was nothing to actually fix in the library. |
Thank you man, worked very well, now i can do everything I need. |
Describe the bug
I cant create a DTO like this:
https://github.com/cnizzardini/cakephp-swagger-bake-demo/blob/1.next/src/Dto/QueryDto.php
with a property like:
* @swag\SwagDtoQuery(name="Value", type="number", format="double", description="Required.")
To Reproduce
Steps to reproduce the behavior:
Expected behavior
Work with number format types.
Version and Platform (please complete the following information):
The text was updated successfully, but these errors were encountered: