-
-
Notifications
You must be signed in to change notification settings - Fork 84
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
Unable to deserialize ui nodes of type script #157
Comments
Thank you for the report! Could you try a more recent version of the SDK please? :) 0.0.1-alpha.124 is the most recent |
Hi, Still not working. Tested on version 0.0.1-alpha.131. |
I see, I thought this might already have been fixed but apparently it has not. Thank you for the report, your analysis looks on point. |
I looked into this, I guess the problem is that the DotNet SDK is not using the discriminator but rather trying to decode the paylaod in whatever struct it knows? The problem is that I think the problem might be that we're overriding the template. I'll try removing the override and that might resolve the issue for DotNet. |
Ok, unfortunately my assumption was not correct. We do indeed use the dotnet generator from upstream. So I think you found a bug in the OpenAPI Generator template :/ Looking at the code, it appears that the DotNet generator is not using the discriminator value, but instead relying on typing to find the right instance: It appears that the same thing applies for the Go SDK. So you're right, I think the only way to work around this in the generators is to mark width/height as required. I checked the code, and it's not being "unset" anywhere, so I guess this should be a good workaround! |
Hi, We currently have a custom class inheriting from JsonConverter that is overriding the default serialize / deserialize functions and forcing width and height to be required. So far it's working as expected. |
Ok cool, thank you! I think the changes in ory/kratos#2322 should allow you to remove the workaround :) |
Preflight checklist
Describe the bug
While getting the ClientSelfServiceSettingsFlow, if webauthn is enabled, a ui node of type script is sent.
Using the SDK for .NET to deserialize this flow, an error occurs at ClientUiNodeAttributes::FromJson() because both ClientUiNodeScriptAttributes and ClientUiNodeImageAttributes can deserialize the script ui node. This happend because the script ui node has all the mandatory attributes of the ClientUiNodeImageAttributes. Adding Width and/or Height to the mandatory attributes fixes this issue.
Reproducing the bug
Relevant log output
No response
Relevant configuration
No response
Version
0.0.1-alpha.76
On which operating system are you observing this issue?
Windows
In which environment are you deploying?
Docker Compose
Additional Context
No response
The text was updated successfully, but these errors were encountered: