Skip to content

[BUG] [Go] declared type cannot begin with numerals #3226

Open
@mariuspavelnistor

Description

@mariuspavelnistor

Bug Report Checklist

  • [ ] Have you provided a full/minimal spec to reproduce the issue?
    yes
  • [ ] Have you validated the input using an OpenAPI validator ([example]
    (https://apidevtools.org/swagger-parser/online/))?
    yes
  • [ ] What's the version of OpenAPI Generator used?
    4.0.0
  • [ ] Have you search for related issues/PRs?
    yes
  • [ ] What's the actual output vs expected output?

Actual :
package model
// Model5GInterfaceType : 5G interface type
type 5GInterfaceType string
// List of 5GInterfaceType
const (
N2 Model5GInterfaceType = "n2"
N3 Model5GInterfaceType = "n3"
)

Expected :

package model
// Model5GInterfaceType : 5G interface type
type Model5GInterfaceType string
// List of 5GInterfaceType
const (
N2 Model5GInterfaceType = "n2"
N3 Model5GInterfaceType = "n3"
)

  • [Optional] Bounty to sponsor the fix (example)
Description
openapi-generator version
OpenAPI declaration file content or url
Command line used for generation
java -jar ./openapi-generator-cli.jar generate -g go-server -i ./cmd/lizard-rest/yaml/test.yaml -o ./cmd/lizard-rest/generated/ --additional-properties packageName=model

test.txt

Steps to reproduce
Related issues/PRs
Suggest a fix

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions