You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Per the Golang spec, the first character in an identifier must be a letter. When an enum contains strings which are numbers (as in IP versions), these are interpolated into invalid code.
Save above schema into file, run the command in an empty folder, and take a look at model_ip_address_type_enum.go. The identifiers start with numbers, which isn't valid in Go.
// List of IPAddressTypeEnumconst (
4__IpAddressTypeEnumIpAddressTypeEnum="4"6__IpAddressTypeEnumIpAddressTypeEnum="6"
)
Suggest a fix/enhancement
I'm not really sure what the best approach would be. In my specific case, I'm manually changing them to v4 and v6. Maybe prepending an i for i4 and i6 to indicate integer? It isn't especially pretty either way.
I'm new to this codebase, so if I'm doing something weirdly or misunderstanding the purpose of something, please set me on the right track. Thank you all so much for your work on this project!
The text was updated successfully, but these errors were encountered:
Description
Per the Golang spec, the first character in an identifier must be a letter. When an enum contains strings which are numbers (as in IP versions), these are interpolated into invalid code.
Swagger-codegen version
3.0.30
Swagger declaration file content or url
Command line used for generation
Steps to reproduce
Save above schema into file, run the command in an empty folder, and take a look at
model_ip_address_type_enum.go
. The identifiers start with numbers, which isn't valid in Go.Suggest a fix/enhancement
I'm not really sure what the best approach would be. In my specific case, I'm manually changing them to v4 and v6. Maybe prepending an
i
fori4
andi6
to indicate integer? It isn't especially pretty either way.I'm new to this codebase, so if I'm doing something weirdly or misunderstanding the purpose of something, please set me on the right track. Thank you all so much for your work on this project!
The text was updated successfully, but these errors were encountered: