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
In some weird OpenAPI specs, it is possible that you might have an array defined, but no items.
In the current implementation of oapi-codegen, this leads to a nullpointer-exception (NPE).
It would be better, if we could just fallback to an interface type. This way the generated Go-Code is fine and will compile, and it will be up to the user of the generated Go-Library to cast/map the interface{} to the appropiate Go-struct. It should not be a concern that the openapi-spec is crap, as long as we have interface{} available as a placeholder.
The text was updated successfully, but these errors were encountered:
weitzj
pushed a commit
to devk-insurance/oapi-codegen
that referenced
this issue
Oct 18, 2019
This adds a fallback behaviour in case a type cannot
be determined, where one should be expected.
This is for example the case if one defines a type `array`
but does not add any `items` definitions to it.
Fixes:
- oapi-codegen#73
…api-codegen#74)
This adds a fallback behaviour in case a type cannot
be determined, where one should be expected.
This is for example the case if one defines a type `array`
but does not add any `items` definitions to it.
Fixes:
- oapi-codegen#73
In some weird OpenAPI specs, it is possible that you might have an
array
defined, but noitems
.In the current implementation of oapi-codegen, this leads to a nullpointer-exception (NPE).
It would be better, if we could just fallback to an
interface
type. This way the generated Go-Code is fine and will compile, and it will be up to the user of the generated Go-Library to cast/map theinterface{}
to the appropiate Go-struct. It should not be a concern that the openapi-spec is crap, as long as we haveinterface{}
available as a placeholder.The text was updated successfully, but these errors were encountered: