mod util; extern crate apistos_schemars as schemars; use schemars::gen::SchemaSettings; use schemars::JsonSchema; use util::*; #[allow(dead_code)] #[derive(JsonSchema)] struct MyJob { spec: MyJobSpec, } #[allow(dead_code)] #[derive(JsonSchema)] struct MyJobSpec { replicas: u32, } #[test] fn struct_normal() -> TestResult { let mut settings = SchemaSettings::default(); settings.inline_subschemas = true; test_generated_schema::("inline-subschemas", settings) } #[allow(dead_code)] #[derive(JsonSchema)] struct RecursiveOuter { direct: Option>, indirect: Option>, } #[allow(dead_code)] #[derive(JsonSchema)] struct RecursiveInner { recursive: RecursiveOuter, } #[test] fn struct_recursive() -> TestResult { let mut settings = SchemaSettings::default(); settings.inline_subschemas = true; test_generated_schema::("inline-subschemas-recursive", settings) }