You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
While using create_native_registration_flow, I ran into the following bug:
called `Result::unwrap()` on an `Err` value: Serde(Error("missing field `node_type`", line: 1, column: 508))
It seems to have occurred once before in #325 and appeared again
Reproducing the bug
Run the following code:
use ory_client::apis::{
configuration::Configuration, frontend_api::create_native_registration_flow,};#[tokio::main]asyncfnmain(){create_native_registration_flow(&Configuration{base_path:"http://localhost:4433".to_string(),
..Default::default()},None,None,).await.unwrap();}
Relevant log output
called `Result::unwrap()` on an `Err` value: Serde(Error("missing field `node_type`", line: 1, column: 508))
Relevant configuration
No response
Version
Kratos 1.3.0
On which operating system are you observing this issue?
macOS
In which environment are you deploying?
Docker Compose
Additional Context
docker image: oryd/kratos:v1.3.0
cargo:
ory-client = { git = "https://github.com/ory/client-rust", tag = "v1.14.5" }
The text was updated successfully, but these errors were encountered:
Did a little testing locally and found out that the autogenerator might be a little off:
According to serde library: https://serde.rs/enum-representations.html#internally-tagged
When using #[serde(tag = "node_type")], the relevant field should not appear in the enum item's struct, however, the
autogenerator seems to have included node_type in the item, causing the deserialize to fail
// https://github.com/ory/client-rust/blob/10027729688da0967e45cf7d7e1b8a1ec5ea8173/src/models/ui_node_attributes.rs#L16#[derive(Clone,Debug,PartialEq,Serialize,Deserialize)]#[serde(tag = "node_type")]pubenumUiNodeAttributes{#[serde(rename="input")]Input(Box<models::UiNodeInputAttributes>),
...
}// https://github.com/ory/client-rust/blob/10027729688da0967e45cf7d7e1b8a1ec5ea8173/src/models/ui_node_input_attributes.rs#L16#[derive(Clone,Default,Debug,PartialEq,Serialize,Deserialize)]pubstructUiNodeInputAttributes{
...
/// NodeType represents this node's types. It is a mirror of `node.type` and is primarily used to allow compatibility with OpenAPI 3.0. In this struct it technically always is \"input\". text Text input Input img Image a Anchor script Script#[serde(rename = "node_type")]pubnode_type:NodeTypeEnum,
...
}
One method to resolve is to remove node_type field from the struct of UiNodeXXXAttributes (e.g. UiNodeInputAttributes, etc.)
Preflight checklist
Ory Network Project
No response
Describe the bug
While using
create_native_registration_flow
, I ran into the following bug:It seems to have occurred once before in #325 and appeared again
Reproducing the bug
Run the following code:
Relevant log output
Relevant configuration
No response
Version
Kratos 1.3.0
On which operating system are you observing this issue?
macOS
In which environment are you deploying?
Docker Compose
Additional Context
docker image: oryd/kratos:v1.3.0
cargo:
The text was updated successfully, but these errors were encountered: