If there is 2 or more types with same name, they will override each other, when schema generated. For example
handler1.rs
#[derive(JsonSchema)]
struct Request {
name: String
}
handler2.rs
#[derive(JsonSchema)]
struct Request {
id: u64
}
will create only one definition in #/components/schema, and handlers from both files wil reference same schema.
First potenial fix - enable inlining in https://docs.rs/schemars/latest/schemars/gen/struct.SchemaSettings.html#structfield.inline_subschemas, which will solve most problems (probably everything sxcept recursive types).
If there is 2 or more types with same name, they will override each other, when schema generated. For example
handler1.rs
handler2.rs
will create only one definition in
#/components/schema, and handlers from both files wil reference same schema.First potenial fix - enable inlining in https://docs.rs/schemars/latest/schemars/gen/struct.SchemaSettings.html#structfield.inline_subschemas, which will solve most problems (probably everything sxcept recursive types).