-
-
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
ory-client 1.6.1 deserialization error on get_registration_flow #325
Comments
Hi, this issue is known, it's a bug with an upstream project. The nodetype is found in the field that serializes the UI. You can solve it by manually renaming that field in the correct snake case. Not however that it is possible to simply deserialize the response into a nother type that omits the field entirely. When serde encounters a struct field in the data stream not defined for the T it is deserializing into, it simply ignores that field gracefully. Not only will this skip this error in particular it should avoid quite a few allocations and the cpu overhead of deserializing into memory your program never otherwise accesses. Additionally, the ory sdk doesn't follow semver, so deserializing only the fields you actually use minimizes the chance of running into breaking changes in production. I'm a user not an employee of Ory, nor is this recommended anywhere I can find, and I could well be wrong here. But I've done this myself and it's been working fine so far. it's just my own common practice of trying to wrangle the messiness of REST in strongly typed languages. |
I stumbled on this while working on my project with the Rust SDK, having the same issue with |
To be clear you can just fork the project and rename My suggestion was a more general best practice that solves the issue incidentally. The API very eagerly overfetches a lot of data for most use cases. |
We have released the latest version of the SDK as all the pipeline issues have been fixed. This should be addressed now by upgrading the package :) |
Preflight checklist
Ory Network Project
No response
Describe the bug
Err(
Serde(
Error("missing field
nodetype
", line: 1, column: 640),),
)
Reproducing the bug
main.rs:
Cargo.toml:
Relevant log output
Err( Serde( Error("missing field `nodetype`", line: 1, column: 640), ), )
Relevant configuration
No response
Version
latest self hosted kratos
On which operating system are you observing this issue?
None
In which environment are you deploying?
None
Additional Context
I tried manually quesrying the endpoint without ory_client sdk using reqwest and the following code:
and got the following output:
The text was updated successfully, but these errors were encountered: