use sqlx.types.Json<T>
as a schema in utoipa
#650
Unanswered
vncsalencar
asked this question in
Q&A
Replies: 1 comment
-
Three solution:
e.g. #[derive(..., utoipa::ToSchema)]
struct Foo {
...
#[schema(schema_with = create_sqlx_json_schema::<Bar>)]
pub bar: sqlx.types.Json<Bar>,
...
}
pub fn create_sqlx_json_schema<T: for<'a> ToSchema<'a>>() -> Object {
ObjectBuilder::new()
.property("inner", ...)
.required("inner")
.build()
} |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
When using a struct that has
Could not resolve reference: Could not resolve pointer: /components/schemas/sqlx.types.Json does not exist in document`.
sqlx.types.Json<T>
, utoipa throwsHow does one deal with it?
Beta Was this translation helpful? Give feedback.
All reactions