Closed fraschm1998 closed 2 months ago
Hi, this issue is known, it's a bug with an upstream project.
https://github.com/ory/sdk/issues/276#issuecomment-1753229752
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 create_browser_login_flow
. It sounds like the workaround is to use reqwest and create my own types, but I wanted to add a +1 that this is a pretty work-blocking issue if you want to use your own UI.
I stumbled on this while working on my project with the Rust SDK, having the same issue with
create_browser_login_flow
. It sounds like the workaround is to use reqwest and create my own types, but I wanted to add a +1 that this is a pretty work-blocking issue if you want to use your own UI.
To be clear you can just fork the project and rename nodetype
to node_type
and it should solve the issue. It's a casing error.
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
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: