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
Describe the bug
When I try to use #[endpoint(request_body = ref("./external.json"))] to reference an external file, as per the Salvo documentation, I encounter a compilation error. It appears that the ref keyword may be causing a conflict, possibly because it's also a reserved word in Rust.
error: unexpected token, expected type such as String, expected identifier
--> src/main.rs:3:31
|
3 | #[endpoint(request_body = ref("./external.json"))]
| ^^^^^^^^^^^^^^^^^
Expected behavior
I expected this code to compile successfully, allowing ref("./external.json") to refer to an external JSON file as the request body.
Screenshots
Not applicable.
Desktop (please complete the following information):
OS: [Your OS]
Browser: Not applicable
Version: Not applicable
Additional context
It seems that ref might be causing a conflict due to its status as a Rust reserved word, but I’m not certain. I’d appreciate any guidance on how best to approach this or if there’s a workaround. Thank you for all the hard work on Salvo—it's a great framework, and any help would be greatly appreciated!
The text was updated successfully, but these errors were encountered:
Describe the bug
When I try to use
#[endpoint(request_body = ref("./external.json"))]
to reference an external file, as per the Salvo documentation, I encounter a compilation error. It appears that theref
keyword may be causing a conflict, possibly because it's also a reserved word in Rust.To Reproduce
Steps to reproduce:
cargo build
.Expected behavior
I expected this code to compile successfully, allowing
ref("./external.json")
to refer to an external JSON file as the request body.Screenshots
Not applicable.
Desktop (please complete the following information):
Additional context
It seems that
ref
might be causing a conflict due to its status as a Rust reserved word, but I’m not certain. I’d appreciate any guidance on how best to approach this or if there’s a workaround. Thank you for all the hard work on Salvo—it's a great framework, and any help would be greatly appreciated!The text was updated successfully, but these errors were encountered: