Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • O openapi-generator
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 3,476
    • Issues 3,476
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 402
    • Merge requests 402
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • OpenAPI Tools
  • openapi-generator
  • Merge requests
  • !8988

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

  • Review changes

  • Download
  • Email patches
  • Plain diff
Merged Administrator requested to merge github/fork/lucafuji/fix_def_resteasy into master Mar 17, 2021
  • Overview 0
  • Commits 12
  • Pipelines 0
  • Changes 5

Created by: lucafuji

This PR fixes #8986 (closed) 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

Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: github/fork/lucafuji/fix_def_resteasy