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
It seems like since #13680 openapi-generator's Go template assumes that JSON responses are single objects. But when ran against APIs that returns object arrays, it panics when trying to parse error messages. I've chased this down to the use of formatErrorMessage as demonstraded on Go Playground FQ8Js4GaBuv.
openapi-generator version
6.2.1 onwards. Reproduced against 6.5.0, which is latest stable as of this writing. 6.2.0 presents no problem.
Description
It seems like since #13680 openapi-generator's Go template assumes that JSON responses are single objects. But when ran against APIs that returns object arrays, it panics when trying to parse error messages. I've chased this down to the use of
formatErrorMessage
as demonstraded on Go Playground FQ8Js4GaBuv.openapi-generator version
6.2.1 onwards. Reproduced against 6.5.0, which is latest stable as of this writing. 6.2.0 presents no problem.
OpenAPI declaration file content or url
Suggest a fix
Maybe ensuring that
metaValue
' is a struct (by virtue of it's Kind field) before callingFieldByName
will do the trick. See the docs for FieldByName.The text was updated successfully, but these errors were encountered: