-
-
Notifications
You must be signed in to change notification settings - Fork 7.4k
Closed
Description
Description
Created a API Spec with a query parameter of type integer, with format int64 which results to Long in Java. Leads to a broken spring Api with thr following signature:
default ResponseEntity<NotificationSummary> notifications(@ApiParam(value = "The maximum number of Records in the Result", defaultValue = "10l") @Valid @RequestParam(value = "maxResults", required = false, defaultValue="10l") Long maxResults) {
10l should be 10 instead, otherwise a numberFormatException occurs.
openapi-generator version
On the Master (3.3.0)
OpenAPI declaration file content or url
Command line used for generation
java -jar modules/openapi-generator-cli/target/openapi-generator-cli.jar generate \
-i .../basicspec.yml \
-l spring --library spring-mvc \
o .../
Steps to reproduce
- create a spec with the postet yaml
- run the posted command
- take a look to the generated code in org/openapitools/api/NotificationsApi.java
Suggest a fix/enhancement
Generate
default ResponseEntity<NotificationSummary> notifications(@ApiParam(value = "The maximum number of Records in the Result", defaultValue = "10") @Valid @RequestParam(value = "maxResults", required = false, defaultValue="10") Long maxResults) {
instead of
default ResponseEntity<NotificationSummary> notifications(@ApiParam(value = "The maximum number of Records in the Result", defaultValue = "10l") @Valid @RequestParam(value = "maxResults", required = false, defaultValue="10l") Long maxResults) {
Reactions are currently unavailable