https://www.ory.sh/ logo
#talk-kratos
Title
# talk-kratos
j

jolly-jelly-9637

11/09/2021, 11:04 AM
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

high-optician-2097

11/09/2021, 11:07 AM
what version of the SDK are you using?
j

jolly-jelly-9637

11/09/2021, 11:09 AM
h

high-optician-2097

11/09/2021, 11:09 AM
ah damn, unfortunate - we merged some fixes for discriminators in 0.8 but if that also doesn’t work in java…man…
j

jolly-jelly-9637

11/09/2021, 11:12 AM
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

high-optician-2097

11/09/2021, 11:15 AM
shit 😕 well they always accept PRs I think if you’re open to that 😄 I don’t know any java 😕
j

jolly-jelly-9637

11/09/2021, 11:17 AM
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 😭
9 Views