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
There are many examples of extracting a schema from a rust type. But what I would really like is for me to deserialize a RootSchema from my backend, and use it to validate incoming data entirely dynamically. In other words, my code will only have a RootSchema but no concrete types that have #[derive(JsonSchema)].
As far as I can tell, there is no way to do this with schemars.
The text was updated successfully, but these errors were encountered:
My understanding is that this crate is intended to provide the ability to generate JSON Schema.
What axum_jsonschema does is to create a JSON Schema with schemars and then validate it using jsonschema and serde_json.
(#[derive(Deserialize, JsonSchema)] is required for struct)
If you want to validate a structure after deserializing it with serde_json, you can use a combination of schemars and validator.
(#[derive(Deserialize, JsonSchema, Validate)] is required for struct)
In any case, a devive like #[derive(JsonSchema)] is necessary if you want to use schemars.
There are many examples of extracting a schema from a rust type. But what I would really like is for me to deserialize a RootSchema from my backend, and use it to validate incoming data entirely dynamically. In other words, my code will only have a RootSchema but no concrete types that have
#[derive(JsonSchema)]
.As far as I can tell, there is no way to do this with schemars.
The text was updated successfully, but these errors were encountered: