[oapi] salvo::prelude::ToSchema is not implemented for JsonValue #314
Answered
by
chrislearn
josejachuf
asked this question in
Q&A
-
Continuing with the migration of the app from the documentation using utoipa bookstore by hand to the integration of oapi in salvo. I have the struct
Actually my field must be of type Option<Vec>, but sqlx gives me a mistake. That's another topic that I'm going to see in sqlx. Summarizing, using utoipa with:
works fine, but with the one integrated in Salvo, it gives the aforementioned error |
Beta Was this translation helpful? Give feedback.
Answered by
chrislearn
Jul 11, 2023
Replies: 1 comment 1 reply
-
Try this: #[derive(FromRow, Serialize, ToSchema, Debug)]
pub struct MyStruct {
...
...
#[salvo(schema(value_type = Option<Object>))]
pub my_field: Option<serde_json::Value>,
} |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
josejachuf
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Try this: