juhaku / utoipa

Simple, Fast, Code first and Compile time generated OpenAPI documentation for Rust
Apache License 2.0
2k stars 160 forks source link

Add `description` attribute on `ToSchema` #949

Closed juhaku closed 1 month ago

juhaku commented 1 month ago

Add support for overriding description with description attribute on ToSchema macro. Description attributes can be used type level of struts and enums.

Example of enum which uses description overriding.

 #[schema(
     description = include_str!("./testdata/description_override")
 )]
 enum SimpleEnum {
     Value1
 }

Resolves #802