//! Doctests for ToSchema derive macro

/// ```
/// # use buoyant_kernel as delta_kernel;
/// # use delta_kernel_derive::ToSchema;
/// #[derive(ToSchema)]
/// pub struct WithFields {
///     some_name: String,
/// }
/// ```
#[cfg(doctest)]
pub struct MacroTestStructWithField;

/// ```compile_fail
/// # use buoyant_kernel as delta_kernel;
/// # use delta_kernel_derive::ToSchema;
/// #[derive(ToSchema)]
/// pub struct NoFields;
/// ```
#[cfg(doctest)]
pub struct MacroTestStructWithoutField;

/// ```
/// # use buoyant_kernel as delta_kernel;
/// # use delta_kernel_derive::ToSchema;
/// # use std::collections::HashMap;
/// #[derive(ToSchema)]
/// pub struct WithAngleBracketPath {
///     map_field: HashMap<String, String>,
/// }
/// ```
#[cfg(doctest)]
pub struct MacroTestStructWithAngleBracketedPathField;

/// ```
/// # use buoyant_kernel as delta_kernel;
/// # use delta_kernel_derive::ToSchema;
/// # use std::collections::HashMap;
/// #[derive(ToSchema)]
/// pub struct WithAttributedField {
///     #[allow_null_container_values]
///     map_field: HashMap<String, String>,
/// }
/// ```
#[cfg(doctest)]
pub struct MacroTestStructWithAttributedField;

/// ```compile_fail
/// # use buoyant_kernel as delta_kernel;
/// # use delta_kernel_derive::ToSchema;
/// #[derive(ToSchema)]
/// pub struct WithInvalidAttributeTarget {
///     #[allow_null_container_values]
///     some_name: String,
/// }
/// ```
#[cfg(doctest)]
pub struct MacroTestStructWithInvalidAttributeTarget;

/// Verify that `#[allow_null_container_values]` works on `Option<HashMap<_, _>>` fields.
/// This is needed for optional map fields like `Remove.partition_values` that can contain
/// null values.
/// ```
/// # use buoyant_kernel as delta_kernel;
/// # use delta_kernel_derive::ToSchema;
/// # use std::collections::HashMap;
/// #[derive(ToSchema)]
/// pub struct WithOptionalAttributedField {
///     #[allow_null_container_values]
///     map_field: Option<HashMap<String, String>>,
/// }
/// ```
#[cfg(doctest)]
pub struct MacroTestStructWithOptionalAttributedField;

/// Verify that `#[allow_null_container_values]` fails on `Option<_>` fields that are not maps.
/// ```compile_fail
/// # use buoyant_kernel as delta_kernel;
/// # use delta_kernel_derive::ToSchema;
/// #[derive(ToSchema)]
/// pub struct WithInvalidOptionalAttributeTarget {
///     #[allow_null_container_values]
///     some_name: Option<String>,
/// }
/// ```
#[cfg(doctest)]
pub struct MacroTestStructWithInvalidOptionalAttributeTarget;

/// ```compile_fail
/// # use buoyant_kernel as delta_kernel;
/// # use delta_kernel_derive::ToSchema;
/// # use syn::Token;
/// #[derive(ToSchema)]
/// pub struct WithInvalidFieldType {
///     token: Token![struct],
/// }
/// ```
#[cfg(doctest)]
pub struct MacroTestStructWithInvalidFieldType;
