Closed fistons closed 2 months ago
Would it be possible to use the include_str! macro inside openapi derive macro tag attribute, like it is possible with the info attribute?
include_str!
openapi
tag
info
#[derive(OpenApi)] #[openapi( info(description=include_str!("../documentation/description.md")), // <--- This works paths(get_channels, create_channel), components(schemas(crate::routes::Channel, crate::routes::CreateChannelRequest)), tags( (name="My Tag", description=include_str!("../documentation/channels.md")) // <--- This fails ), )] pub struct ApiDoc;
This is the error I got:
error: expected string literal --> src/openapi.rs:9:39 | 9 | (name="Channels", description=include_str!("../documentation/channels.md")) |
Looking quickly at the sources, it seems that Info Description uses a certain Type that allow both String and include_str!. Would it be possible to reuse this Type here?
String
Would it be possible to use the
include_str!
macro insideopenapi
derive macrotag
attribute, like it is possible with theinfo
attribute?This is the error I got:
Looking quickly at the sources, it seems that Info Description uses a certain Type that allow both
String
andinclude_str!
. Would it be possible to reuse this Type here?