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
This is a feature request to support custom struct field names.
We have a situation where we are using allOf to reference a JSON schema that has a property with a similar name. After the name gets sanitized for Go, it ends up duplicating a field name that already exists.
This is a feature request to support custom struct field names.
We have a situation where we are using
allOf
to reference a JSON schema that has a property with a similar name. After the name gets sanitized for Go, it ends up duplicating a field name that already exists.Example:
parentschema.json
components in the OpenAPI Spec
Because there's a property in the parentschema.json called
@id
, and a property in the OpenAPI schema calledid
, the generated code will outputWhich obviously won't compile because of the duplicate field in the struct. If we could add support for custom field names, that would help.
An alternative approach would be to add an X-Extension for
x-go-fieldname-prefix
to prefix the property so that it generates this insteadThe text was updated successfully, but these errors were encountered: