use quote::quote;
pub struct Schemars;
impl super::Integration for Schemars {
fn name(&self) -> &'static str {
"schemars"
}
fn names_api_runtime(&self) -> bool {
true
}
fn items(&self, context: &super::Context<'_>) -> proc_macro2::TokenStream {
super::api_feature_check(context, "Schemars")
}
fn sort_direction(&self, context: &super::Context<'_>) -> Option<proc_macro2::TokenStream> {
let runtime = context.runtime;
Some(quote!(#runtime::SortDirectionDto))
}
fn sort_field(&self, _context: &super::Context<'_>) -> super::TypeAdditions {
super::TypeAdditions {
derives: vec![quote!(schemars::JsonSchema)],
attributes: quote!(#[schemars(rename_all = "snake_case")]),
}
}
fn sort_details(&self, _context: &super::Context<'_>) -> super::TypeAdditions {
super::TypeAdditions {
derives: vec![quote!(schemars::JsonSchema)],
attributes: quote!(),
}
}
fn query_params(&self, _context: &super::Context<'_>) -> super::TypeAdditions {
super::TypeAdditions {
derives: vec![quote!(schemars::JsonSchema)],
attributes: quote!(),
}
}
}