-
Notifications
You must be signed in to change notification settings - Fork 198
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Could not resolve reference: /components/schemas/PathBuf does not exist in document #656
Comments
Any information on this? thanks |
Hey, firstly I am sorry for long latency in reply times. Recently I have been quite busy, near burn out and just came from 1 week holiday. After all this project is only a free time project without full-time allocation that will also take it's toll. Thanks for understanding. But in short you can either use the #[derive(ToSchema)]
struct Item {
#[schema(value_type = String)]
path: PathBuf,
}
// .. schema_with,
#[derive(ToSchema)]
struct Item {
#[schema(schema_with = String::schema)]
path: PathBuf,
} The #[derive(ToSchema)]
#[schema(as = PathBuf, value_type = String)]
struct MyPath(PathBuf);
struct Item {
#[schema(inline)]
path: MyPath
} If no Note! I am not sure whether the Docs https://docs.rs/utoipa/latest/utoipa/derive.ToSchema.html#named-fields-optional-configuration-options-for-schema say misleadingly Hope these will lead you to the right tracks. Related to #383 (comment) #330 (comment) #390 #507 (comment) |
Thanks a lot for the reply. |
Hi.
I understand the concept of adding stuff to the
schemas()
and add the deriveToSchema
on any struct we might be using. But how i'm I supose to addToSchema
to aPathBuf
, or any external lib that I might be using like ByteSize for example ? thanks.The text was updated successfully, but these errors were encountered: