-
Notifications
You must be signed in to change notification settings - Fork 6k
Description
Description
The swagger-codegen generates for spring server an interface where there is a too long string constant based on the swagger definition.
...
default ResponseEntity<List<Customer>> customerFind(@ApiParam(value = "") @Valid @RequestParam(value = "relatedPartyId", required = false) String relatedPartyId,@ApiParam(value = "") @Valid @RequestParam(value = "relatedPartyRole", required = false) String relatedPartyRole,@ApiParam(value = "") @Valid @RequestParam(value = "fields", required = false) String fields,@ApiParam(value = "") @Valid @RequestParam(value = "query", required = false) String query,@ApiParam(value = "Defines page") @Valid @RequestParam(value = "page", required = false) BigDecimal page,@ApiParam(value = "Limits the number of results for paging") @Valid @RequestParam(value = "size", required = false) BigDecimal size,@ApiParam(value = "Entity ordering") @Valid @RequestParam(value = "sort", required = false) String sort) {
if(getObjectMapper().isPresent() && getAcceptHeader().isPresent()) {
if (getAcceptHeader().get().contains("application/json")) {
try {
return new ResponseEntity<>(getObjectMapper().get().readValue("[ { \"characteristics\" : [ .................... too long string constant
It ends with compilation error:
...\build\generated-sources\swagger\src\main\java\sk\telekom\oneapp\hal\api\CustomersApi.java:71: error: constant string too long
return new ResponseEntity<>(getObjectMapper().get().readValue("[ { \"charact
Swagger-codegen version
2.4.0
Swagger declaration file content or url
https://gist.github.com/drej1/418d1dfa7924471a664fcd4e6fb6b3d2
Command line used for generation
used created gradle task using swagger-codegen with:
config.setLang("spring")
config.setAdditionalProperties([
"modelPackage" : modelPackage,
"apiPackage" : apiPackage,
"java8" : true,
"serializableModel": true,
"interfaceOnly" : true
])
Steps to reproduce
- generate spring API server interfaces for yaml with a really complex type definition
Suggest a fix/enhancement
gunnarr-u, mteodori, Savak, joranb and pc-lcong
Metadata
Metadata
Assignees
Labels
No labels