Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • O openapi-generator
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 3,476
    • Issues 3,476
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 402
    • Merge requests 402
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • OpenAPI Tools
  • openapi-generator
  • Issues
  • #1051
Closed
Open
Issue created Sep 17, 2018 by Administrator@rootContributor

[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.

issue.zip

Related issues/PRs
Suggest a fix/enhancement
Assignee
Assign to
Time tracking