OpenAPI Generator allows generation of API client libraries (SDK generation), server stubs, documentation and configuration automatically given an OpenAPI Spec (v2, v3)
[ ] [Optional] Sponsorship to speed up the bug fix or feature request (example)
Description
API parameters of type integer and format int64, have a trailing "L" appended to their default values in spring controllers. This creates broken controllers since spring parses this with Long.valueOf which does not allow for the trailing character.
Bug Report Checklist
Description
API parameters of type
integer
and formatint64
, have a trailing "L" appended to their default values in spring controllers. This creates broken controllers since spring parses this withLong.valueOf
which does not allow for the trailing character.This was added in https://github.com/OpenAPITools/openapi-generator/pull/13507/files to support default values in client models.
Actual Output:
Expected Output:
openapi-generator version
Introduced in 6.2.1, tested on current
OpenAPI declaration file content or url
Generation Details
kotlin-spring
Steps to reproduce
Create a spec file called
sample.yaml
with the provided sample, and run generation with thekotlin-spring
generator.Check the generated controller function.
Related issues/PRs
The same issue was addressed in the java-spring generator.
Suggest a fix
Add a override in KotlinServerCodegen similar to https://github.com/OpenAPITools/openapi-generator/pull/4969/files to remove the suffix for parameters.