Skip to main content

specta_jsonschema/
layout.rs

1/// Controls how JSON schemas are organized in output
2#[derive(Debug, Clone, Copy, PartialEq, Eq)]
3pub enum Layout {
4    /// Single file with all types in $defs section (default)
5    /// All type definitions are placed in a single JSON file under the
6    /// definitions/$defs key.
7    SingleFile,
8
9    /// Separate .json file per type, organized by module path
10    /// Each type gets its own file like: `my_module/MyType.schema.json`
11    Files,
12}
13
14impl Default for Layout {
15    fn default() -> Self {
16        Self::SingleFile
17    }
18}