Skip to content

[Java][Jaxrs-Resteasy] Fixes generator devaultValues for int64/float/…#8988

Merged
wing328 merged 12 commits intoOpenAPITools:masterfrom
lucafuji:fix_def_resteasy
Mar 24, 2021
Merged

[Java][Jaxrs-Resteasy] Fixes generator devaultValues for int64/float/…#8988
wing328 merged 12 commits intoOpenAPITools:masterfrom
lucafuji:fix_def_resteasy

Conversation

@lucafuji
Copy link
Contributor

@lucafuji lucafuji commented Mar 17, 2021

This PR fixes #8986
That issue describes that when we have an in64, float, or double CodegenParameter, the string defaultValue includes unneeded suffix characters l,f, or d. Those suffixes were added by AbstractJavaCodegen because that generator assumed that those default values would be used as java values of the correct type. Instead, the spring generator uses String type default values for CodegenParameter only. Typically those values are handled with parseLong/parseFloat/parseDouble etc which fail if the value includes a character suffix.

we now use values which lack the suffix so parseLong/parseDouble/parseFloat will work
CodegenParameter defaultValues:

"21474836487" (int64)
"3.14159" (float)
"3.14159" (double)

Verification Test
A test has been added at https://github.com/OpenAPITools/openapi-generator/pull/8988/files#diff-ecbab4cf643943739b9ce7e56d73b1b391b4ce6d09310326e8ea9d023da164b8R41

@lucafuji
Copy link
Contributor Author

@wing328 Not sure how to assign this PR to you but please take a look, thanks

@lucafuji
Copy link
Contributor Author

@wing328 It seems the build keeps failing due to the docker pull limit
anyrequests: You have reached your pull rate limit. You may increase the limit by authenticating and upgrading: https://www.docker.com/increase-rate-limit The command "docker pull swaggerapi/petstore" failed and exited with 1 during .

Any thing we can do to let it pass?

Copy link
Member

@wing328 wing328 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thanks for the fix 👍

@wing328 wing328 merged commit 7e0382b into OpenAPITools:master Mar 24, 2021
@wing328 wing328 added this to the 5.1.1 milestone Apr 30, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Query Parameters of type integer in format int64 seem to create a broken rest easy API

3 participants