[Java][jaxrs-resteasy] wrong matching between yaml enum value starting with a digit and its java code
Created by: tnmtechnologies
Description
A yaml enum value like 5GMM is translated into java enum value _5GMM. Because of that, the supported value at runtime is now _5GMM which doesn't match the yaml definition.
openapi-generator version
3.2.3
OpenAPI declaration file content or url
In file TS29518_Namf_Communication.yaml
# line 1510
N1MessageClass:
type: string
enum:
- "5GMM"
- "SM"
- "LPP"
- "SMS"
Then the generated java source code for enum N1MessageClass is :
package org.openapitools.model;
import java.util.Objects;
import java.util.ArrayList;
import com.fasterxml.jackson.annotation.JsonValue;
import javax.validation.constraints.*;
public enum N1MessageClass {
_5GMM, SM, LPP, SMS
}
Command line used for generation
java -jar ./openapi-generator-cli-3.2.3.jar generate -i TS29518_Namf_Communication.yaml -g jaxrs-resteasy -o generated-files
Steps to reproduce
Please unzip the attached file and type the command (see above) in the directory where files are stored. Looks for the generated java enum N1MessageClass file in the generated-files directory. A copy of the generated source files is available under the generated-files.sav folder.