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
When I have a schema component with the name Value the #[derive(OpenApi)] produces unparsable tokens:
error: expected expression, found `,`
--> src/main.rs:8:10
|
8 | #[derive(OpenApi)]
| ^^^^^^^ expected expression
|
= note: this error originates in the derive macro `OpenApi` (in Nightly builds, run with -Z macro-backtrace for more info)
error: expected one of `.`, `;`, `?`, `else`, or an operator, found `)`
--> src/main.rs:8:10
|
8 | #[derive(OpenApi)]
| ^^^^^^^ expected one of `.`, `;`, `?`, `else`, or an operator
|
= note: this error originates in the derive macro `OpenApi` (in Nightly builds, run with -Z macro-backtrace for more info)
error: proc-macro derive produced unparsable tokens
--> src/main.rs:8:10
|
8 | #[derive(OpenApi)]
| ^^^^^^^
The repro itself is shorter than the error:
use utoipa::{OpenApi,ToSchema};#[derive(ToSchema)]structValue{val:&'static str,}#[derive(OpenApi)]#[openapi(components(schemas(Value)))]structApi;fnmain(){println!("Hello, world!");}
Renaming the Value struct fixes the issue.
The error is quite hard to decipher as the error reported has nothing to do with the actual problem.
It was working fine under Utoipa 4.x but it's broken under 5.0.
The text was updated successfully, but these errors were encountered:
When I have a schema component with the name
Value
the#[derive(OpenApi)]
produces unparsable tokens:The repro itself is shorter than the error:
Renaming the
Value
struct fixes the issue.The error is quite hard to decipher as the error reported has nothing to do with the actual problem.
It was working fine under Utoipa 4.x but it's broken under 5.0.
The text was updated successfully, but these errors were encountered: