Skip to content

[JAVA] POJO descriptions - "The type generates a string that requires more than 65535 bytes to encode in Utf8 format in the constant pool" #11136

@yungw-pcc

Description

@yungw-pcc
Description

In our documentation there is a description that is over 65kb long. It scans fine however when generating the POJOs the strings in annotations can only be up to 65kb.

Swagger-codegen version

CLI 3.0.27

Swagger declaration file content or url
....
description: string greater than 65kb
...
Command line used for generation

java -jar swagger-codegen-cli.jar generate -i swagger.json -l java

Steps to reproduce
  1. Have a yaml file with a description field greater the 65kb
  2. Scan with codegen - java -jar swagger-codegen-cli.jar generate -i swagger.json -l java
  3. Client won't compile because "The type generates a string that requires more than 65535 bytes to encode in Utf8 format in the constant pool" for the following annotation @Schema(required = true, description = "")
Related issues/PRs

Didn't find any

Suggest a fix/enhancement

The description should maybe be truncated when referenced in annotations

@ApiModelProperty({{#example}}example = "{{{example}}}", {{/example}}{{#required}}required = {{required}}, {{/required}}value = "{{{description}}}")

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions