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
Right now in my OpenAPI yaml, we have a component with a field that is marked as follows:
type: objectadditionalProperties: true
This results in a generated object like this: map[string]jx.Raw, where jx.Raw is a []byte under the hood.
That is pretty hard to use.
I'd have to manually json marshal every single property, rather than just setting them all and letting the whole thing be json marshalled.
I've tried 3 other OpenAPI code generators, and they all give me a map[string]any, letting us use this field for any key-value pairs (this is our desired goal).
This change should be backwards compatible, as jx.Raw counts as an any.
The ogen server/client should take care of marshalling the any value into json. I also don't think that ogen should be exposing jx, as that is an implementation detail.
The text was updated successfully, but these errors were encountered:
Description
Right now in my OpenAPI yaml, we have a component with a field that is marked as follows:
This results in a generated object like this:
map[string]jx.Raw
, wherejx.Raw
is a[]byte
under the hood.That is pretty hard to use.
I'd have to manually json marshal every single property, rather than just setting them all and letting the whole thing be json marshalled.
I've tried 3 other OpenAPI code generators, and they all give me a
map[string]any
, letting us use this field for any key-value pairs (this is our desired goal).This change should be backwards compatible, as jx.Raw counts as an
any
.The ogen server/client should take care of marshalling the
any
value into json. I also don't think that ogen should be exposing jx, as that is an implementation detail.The text was updated successfully, but these errors were encountered: