-
-
Notifications
You must be signed in to change notification settings - Fork 85
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Deserialization issue when getting self service flow #75
Comments
Dupe of #74 |
Shit, I made a long post that explained the issue but apparently I closed the wrong window. Anyways, the gist of it is that polymorphism with simple types is simply extremely buggy in basically all the generators except for Golang (because I fixed it there) and TypeScript. Apparently, the generator expects polymorphism to always be a JSON object 🤷 So what I did was to remove the typing from the value (which means it can be any type) and re-generated the clients. Could you please check if this works in Java (I have no Java experience...). The generated code with the changes can be found here: https://github.com/ory/sdk/tree/openapi-fixy/clients/kratos/java Thanks! |
@aeneasr, thanks for the quick reply. I just quickly tested your fix and the login and registration flow responses are now deserialized correctly! Hopefully, this fix also solves the issues with the clients in other languages. Could you maybe point out what you exactly changed since db67552 contains a lot of changes in the generated files? |
Ok that's awesome to hear! The problem is that we had a oneOf in the schema with simple types:
This is unfortunately not supported in most openapi-generator templates. There are quite a few issues on that (https://github.com/OpenAPITools/openapi-generator/search?q=oneof+string&type=issues - not all are relevant but maybe 10%). What I did was basically removing that type and the leaving "value" type empty which implies that it is a polymorph type (could also be an object or array, which isn't the case actually, but better than something not working at all!) |
Wohoo! I found the original tab with my findings So I looked into this a bit more and I can't seem to come up with a good solution (also I don't have Java skills...). Basically the problem is this. The
Unfortunately we cannot do
as that generates code in Java which would not compile due to a bug in openapi-generator. The interim step with the In Java, the
with a simple class
backing it.
So in the end I think it's better to just not have any typing here even though the typing appears to be correct. |
Closes ory/sdk#75 Closes ory/sdk#74 Closes ory/sdk#72
Closes ory/sdk#75 Closes ory/sdk#74 Closes ory/sdk#72
Closes ory/sdk#75 Closes ory/sdk#74 Closes ory/sdk#72
That or generate their own client using the openapi-generator and the spec at: https://github.com/ory/kratos/blob/master/spec/openapi.json The 0.7 release is pretty close though: https://github.com/ory/kratos/milestone/9 |
I am getting a deserialization issue when calling
getSelfServiceLoginFlow
(i think any flow will have this issue though) when using both v0.6.3-alpha.1 of kratos and this java client. Previously, I was using v0.5.4-alpha.1 and everything worked fine and I was now looking to upgrade to v0.6. The payload changed of the flows changed betweem these versions so this might be the cause of the issue. I tried it both with the migrated and a clean database but it made no difference. Any ideas?Error log:
The text was updated successfully, but these errors were encountered: