Hello. :slightly_smiling_face: I’m having trouble...
# talk-kratos
j
Hello. 🙂 I’m having trouble using the
kratos-java-client
because it seems that the
openapi-generator
does not support
oneOf
. It generates a client that’s unable to parse the response in the case of
UiNodeAttributes
. The issue is that models such as UiNodeInputAttributes do not extend UiNodeAttributes and they cannot be assigned to
UiNode.attributes
field of type
UiNodeAttributes
. Supposedly
openapi-generator
supports
oneOf
with
--library jersey2
, but I couldn’t run this on jdk11+. 😞 Any java users who have found a clean solution to this? 🙂 The best I can think of is creating custom variations of these
UiNode*Attributes
classes and using
--import-mapping
to reference them.
h
what version of the SDK are you using?
j
h
ah damn, unfortunate - we merged some fixes for discriminators in 0.8 but if that also doesn’t work in java…man…
j
the generated GSON adapters are correct and it can deserialize into
UiNodeInputAttributes
, but at runtime java cannot assign
UiNodeInputAttributes
onto
UiNodeAttributes
because they don’t have a common parent type 😄
I found open issues on openapi-generator but it doesn’t seem like they’ll be working on this any-time soon
h
shit 😕 well they always accept PRs I think if you’re open to that 😄 I don’t know any java 😕
j
there are already some open pull requests for that feature but I don’t see any movement https://github.com/OpenAPITools/openapi-generator/pull/10463 😭