#[cfg(feature = "proc")]
#[proc_macro_derive(ApiModel, attributes(api_prop))]
pub fn derive_api_model(input: proc_macro::TokenStream) -> proc_macro::TokenStream {
    let input = syn::parse_macro_input!(input as syn::DeriveInput);
    apidoc_expand::api_model::expand(input)
        .unwrap_or_else(|err| err.into_compile_error())
        .into()
}

#[cfg(feature = "cod")]
#[proc_macro_derive(ApiModel, attributes(api_prop))]
pub fn derive_api_model(input: proc_macro::TokenStream) -> proc_macro::TokenStream {
    proc_macro::TokenStream::default()
}

#[cfg(feature = "proc")]
#[proc_macro_derive(ApiError, attributes(api_error))]
pub fn derive_api_error(input: proc_macro::TokenStream) -> proc_macro::TokenStream {
    let input = syn::parse_macro_input!(input as syn::DeriveInput);
    apidoc_expand::api_error::expand(&input)
        .unwrap_or_else(|err| err.into_compile_error())
        .into()
}

#[cfg(feature = "cod")]
#[proc_macro_derive(ApiError, attributes(api_error))]
pub fn derive_api_error(input: proc_macro::TokenStream) -> proc_macro::TokenStream {
    proc_macro::TokenStream::default()
}
