Skip to content

[oapi] salvo::prelude::ToSchema is not implemented for JsonValue #314

Answered by chrislearn
josejachuf asked this question in Q&A
Discussion options

You must be logged in to vote

Try this:

#[derive(FromRow, Serialize, ToSchema, Debug)]
pub struct MyStruct {
    ...
    ...
    #[salvo(schema(value_type = Option<Object>))]
    pub my_field: Option<serde_json::Value>,    
}

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@josejachuf
Comment options

Answer selected by josejachuf
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants