We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Describe the bug Some of the #[salvo] attribute macros like #[salvo(response(...))] don't use comma-separated values.
#[salvo]
#[salvo(response(...))]
To Reproduce Example code that fails:
#[derive(Debug, Serialize, Deserialize, ToResponses)] pub enum GeneralError { #[salvo(response(status_code = 400, description = "Bad Request"))] BadRequest(String), #[salvo(response(status_code = 429 description = "Rate Limit Exceeded"))] RateLimit { message: String, retry_after: u64 }, #[salvo(response(status_code = 500 description = "Something went wrong"))] InternalServerError(String), }
The comma after status_code = 400 throws an error:
status_code = 400
error: expected identifier --> crates/rustle_web/src/api.rs:33:39 | 33 | #[salvo(response(status_code = 400, description = "Bad Request"))] | ^
But the second two with just spaces work fine.
Expected behavior
The attribute macros should use commas for separating fields, as it's the Rust standard and is used in other parts of salvo already. E.g:
#[derive(Debug, Serialize, Deserialize, ToResponses)] pub enum GeneralError { #[salvo(response(status_code = 400, description = "Bad Request"))] BadRequest(String), #[salvo(response(status_code = 429, description = "Rate Limit Exceeded"))] RateLimit { message: String, retry_after: u64 }, #[salvo(response(status_code = 500, description = "Something went wrong"))] InternalServerError(String), }
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Describe the bug
Some of the
#[salvo]
attribute macros like#[salvo(response(...))]
don't use comma-separated values.To Reproduce
Example code that fails:
The comma after
status_code = 400
throws an error:But the second two with just spaces work fine.
Expected behavior
The attribute macros should use commas for separating fields, as it's the Rust standard and is used in other parts of salvo already. E.g:
The text was updated successfully, but these errors were encountered: