Closed lrodriguez14 closed 2 years ago
Create a custom type (so not just u64
) and implement JsonSchema
trait for it.
example:
#[derive(Serialize, Deserialize, JsonSchema, FromForm)]
struct Post {
/// The unique identifier for the post.
post_id: u64,
}
Example code: https://github.com/GREsau/okapi/blob/master/examples/json-web-api/src/main.rs#L74-L82
There does not currently exist a macro or something so do this easier.
Other traits might be needed too for Rocket:
https://rocket.rs/v0.5-rc/guide/requests/#query-strings
In your case that is most likely: FromParam
No response and no further action seems to be needed. Closing issue.
I am facing the same issue. is it possible to support the easier way to do this issue?
I am facing the same issue. is it possible to support the easier way to do this issue?
No, currently there is no other (easier) way of solving this. Otherwise we would have to create a macro that basically does the same. But this had not been created up until now.
Hello,
I want to know if there is any way to add a description to the route parameters?
For example:
How can I add a little description for?
As we can see in the image the description is empty
Thanks!