#![deny(
unsafe_code,
missing_docs,
unused_imports,
clippy::cargo,
clippy::pedantic
)]
#![allow(
clippy::must_use_candidate,
clippy::return_self_not_must_use,
clippy::wildcard_imports,
clippy::single_match_else,
clippy::missing_errors_doc,
clippy::module_name_repetitions
)]
#![doc = include_str!("../README.md")]
#![no_std]
extern crate alloc;
#[cfg(feature = "std")]
extern crate std;
mod json_schema_impls;
mod schema;
mod ser;
#[macro_use]
mod macros;
#[doc(hidden)]
pub mod _private;
pub mod generate;
pub mod transform;
#[cfg(feature = "schema_jsonrs_derive")]
extern crate schema_jsonrs_derive;
use alloc::borrow::Cow;
#[cfg(feature = "schema_jsonrs_derive")]
pub use schema_jsonrs_derive::*;
#[doc(inline)]
pub use generate::SchemaGenerator;
pub use schema::Schema;
mod _alloc_prelude {
pub use alloc::borrow::ToOwned;
pub use alloc::boxed::Box;
pub use alloc::format;
pub use alloc::string::{String, ToString};
pub use alloc::vec;
pub use alloc::vec::Vec;
}
#[deprecated = "Only included for backward-compatibility - use the `schema_jsonrs::generate` module instead."]
#[doc(hidden)]
pub mod r#gen {
#[deprecated = "Only included for backward-compatibility - use `schema_jsonrs::SchemaGenerator` or `schema_jsonrs::generate::SchemaGenerator` instead."]
pub type SchemaGenerator = crate::generate::SchemaGenerator;
#[deprecated = "Only included for backward-compatibility - use `schema_jsonrs::generate::SchemaSettings` instead."]
pub type SchemaSettings = crate::generate::SchemaSettings;
#[deprecated = "Only included for backward-compatibility - use `schema_jsonrs::generate::GenTransform` instead."]
pub use crate::generate::GenTransform;
}
pub trait JsonSchema {
fn always_inline_schema() -> bool {
false
}
fn schema_name() -> Cow<'static, str>;
fn schema_id() -> Cow<'static, str> {
Self::schema_name()
}
fn json_schema(generator: &mut SchemaGenerator) -> Schema;
#[doc(hidden)]
fn _schema_jsonrs_private_non_optional_json_schema(generator: &mut SchemaGenerator) -> Schema {
Self::json_schema(generator)
}
#[doc(hidden)]
fn _schema_jsonrs_private_is_option() -> bool {
false
}
}