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
{{ message }}
Repository navigation
Request and response structs getting redeclared in the Go code #1450
When I generate this manifest all the request and response structs are getting declared twice for some reason. When I check the schema I only see them defined once.
Here is an example:
on line 1604 of the output, there is this struct:
// DeleteBusinessResponse defines model for DeleteBusinessResponse.typeDeleteBusinessResponsestruct {
// Success Success valueSuccessbool`json:"success"`
}
But then it is re-declared on line 13872
typeDeleteBusinessResponsestruct {
Body []byteHTTPResponse*http.ResponseJSON200*DeleteBusinessResponseJSON400*BadRequestDtoJSON401*UnauthorizedDtoJSON422*UnprocessableEntityDto
}
Thanks for raising - would you mind confirming if the same issue still happens on the latest version? v2 was a super minor breaking change, so shouldn't be too much to do the upgrade
I'd recommend only using client true when you're using the client, as models shouldn't be necessary, as you'll get all relevant types generated by client
Activity
jamietanna commentedon Feb 11, 2024
Thanks for raising - would you mind confirming if the same issue still happens on the latest version? v2 was a super minor breaking change, so shouldn't be too much to do the upgrade
jamietanna commentedon Feb 11, 2024
That being said, it looks like this is due to:
I'd recommend only using
client truewhen you're using the client, asmodelsshouldn't be necessary, as you'll get all relevant types generated byclientAkrugerus commentedon Mar 19, 2024
I'm encountering the same issue on v2.1.0 using the following config:
I tried removing
models: truebut now many structs are not generating including all Params and RequestBody structs.My OpenAPI spec: https://api.bms.kaseya.com/swagger/v2/swagger.json
Akrugerus commentedon Mar 21, 2024
I found the ResponseTypeSuffix override in output options that avoids this naming overlap when setting it to some value other than Response
MikhailLipanin commentedon Sep 24, 2024
@Akrugerus This helped, thanks!
feat: multi-pass type name resolution
feat: multi-pass type name resolution
feat: multi-pass type name resolution
feat: multi-pass type name resolution
feat: multi-pass type name resolution
feat: multi-pass type name resolution
feat: multi-pass type name resolution
feat: multi-pass type name resolution
feat: multi-pass type name resolution (#2213)
mromaszewicz commentedon Mar 2, 2026
This was addressed in #2213, please enable name conflict resolution via the output options and file a new issue if it doesn't work for you