-
Hi, Thanks for this awesome job with Paperclip. It does provide a very handy set of tools for generating a swagger spec. I love it ! I have a question tho, regarding the addition of a description for the properties of a struct. I tried the following, but was unsuccessful. #[derive(Serialize, Deserialize, Apiv2Schema)]
pub struct Employee {
#[openapi(description = "A description for the first_name property")]
pub first_name: String,
pub last_name: String,
pub department: String,
pub salary: i32,
pub age: i32,
} Can anyone provide me an example as to how to do this? Thanks |
Beta Was this translation helpful? Give feedback.
Answered by
ThomRoux
Jan 25, 2021
Replies: 1 comment
-
Nevermind, I figured it out: #[derive(Serialize, Deserialize, Apiv2Schema)]
pub struct Employee {
/// A description for the first_name property
pub first_name: String,
pub last_name: String,
pub department: String,
pub salary: i32,
pub age: i32,
} |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
wafflespeanut
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Nevermind, I figured it out: