genschema.postprocessing.schema_references¶
Attributes¶
Classes¶
Standalone JSON Schema postprocessor that extracts repeated or highly similar |
Module Contents¶
- type SchemaPath = tuple[PathSegment, ...][source]¶
- type ComparatorFactory = Callable[[], Comparator][source]¶
- type NameFactory = Callable[[int, 'CandidateGroup', 'SchemaReferenceExtractionConfig'], str][source]¶
- DEFAULT_COMPARATOR_FACTORIES: tuple[ComparatorFactory, Ellipsis][source]¶
- STRUCTURAL_CONTAINER_KEYS = ('items', 'additionalProperties', 'contains', 'if', 'then', 'else', 'not', 'propertyNames',...[source]¶
- class SchemaReferenceExtractionConfig[source]¶
-
- merge_pseudo_handler: PseudoArrayHandlerBase | None = None[source]¶
- merge_comparator_factories: tuple[ComparatorFactory, Ellipsis][source]¶
- similarity_metric: SimilarityMetric[source]¶
- merge_strategy: MergeStrategy | None = None[source]¶
- name_factory: NameFactory | None = None[source]¶
- class SchemaCandidate[source]¶
- path: SchemaPath[source]¶
- class SchemaReferencePostprocessor[source]¶
Standalone JSON Schema postprocessor that extracts repeated or highly similar structures into shared definitions and replaces occurrences with
$ref.The postprocessor is intentionally independent from
Converteritself: it can be run on any already-built schema. Candidate groups are merged through a fresh internalConverterrun so the resulting definition stays aligned with the project’s normal schema-combination pipeline.