OpenAPITools / openapi-generator

OpenAPI Generator allows generation of API client libraries (SDK generation), server stubs, documentation and configuration automatically given an OpenAPI Spec (v2, v3)
https://openapi-generator.tech
Apache License 2.0
21.35k stars 6.46k forks source link

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

Open mariuspavelnistor opened 5 years ago

mariuspavelnistor commented 5 years ago

Bug Report Checklist

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" )

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
auto-labeler[bot] commented 5 years ago

👍 Thanks for opening this issue! 🏷 I have applied any labels matching special text in your issue.

The team will review the labels and make any necessary changes.

wing328 commented 5 years ago

@mariuspavelnistor thanks for reporting the issue. I agree this can be better handled in the Go generator similar to what we've done in other generators.

May I know if you have time to contribute the fix? I can show you some good starting points to fix the issue (the fix can be as simple as adding/copying a few lines)

mariuspavelnistor commented 5 years ago

Hi William,

Yes,

I fixed more issues on my local version. But I’m not sure about the procedure I should follow needed to submit.

Let me know what I should do.

Thanks,

Marius

From: William Cheng notifications@github.com Sent: Sunday, June 30, 2019 6:54 AM To: OpenAPITools/openapi-generator openapi-generator@noreply.github.com Cc: Marius Nistor marius.nistor@keysight.com; Mention mention@noreply.github.com Subject: Re: [OpenAPITools/openapi-generator] [BUG] [Go] declared type cannot begin with numerals (#3226)

[EXTERNAL]

@mariuspavelnistorhttps://nam05.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fmariuspavelnistor&data=02%7C01%7C%7C0427342383fc4613101208d6fd0ea20b%7C63545f2732324d74a44dcdd457063402%7C1%7C0%7C636974636621921486&sdata=6FJlGBbv4uu3O%2BdHfVL3Ixr%2F%2BwdLuMAqs8NLEePVg68%3D&reserved=0 thanks for reporting the issue. I agree this can be better handled in the Go generator similar to what we've done in other generators.

May I know if you have time to contribute the fix? I can show you some good starting points to fix the issue (the fix can be as simple as adding/copying a few lines)

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://nam05.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2FOpenAPITools%2Fopenapi-generator%2Fissues%2F3226%3Femail_source%3Dnotifications%26email_token%3DAMOTPFJDHAO3J5YXS6I4AXTP5AU6XA5CNFSM4H3SPY2KYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODY4ESQA%23issuecomment-507005248&data=02%7C01%7C%7C0427342383fc4613101208d6fd0ea20b%7C63545f2732324d74a44dcdd457063402%7C1%7C0%7C636974636621921486&sdata=x5rZ38bWLsrSvGzcDco8Dh5IpFcePrYcIjhfOGWtFEc%3D&reserved=0, or mute the threadhttps://nam05.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FAMOTPFI56FLRBEIPN6T4NRTP5AU6XANCNFSM4H3SPY2A&data=02%7C01%7C%7C0427342383fc4613101208d6fd0ea20b%7C63545f2732324d74a44dcdd457063402%7C1%7C0%7C636974636621931487&sdata=ZAFkU2qly2eYjhXH%2F9yZZVlIogfWwkVhokXXP9KEfbI%3D&reserved=0.

wing328 commented 5 years ago

Would the following help?

https://github.com/OpenAPITools/openapi-generator/wiki/FAQ#how-can-i-submit-a-pr-to-fix-bugs-or-make-enhancements