1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
use ;
use ;
/// Parses a schema `$ref` path and extracts the referenced schema name.
///
/// Returns the schema name if the path references a valid internal component
/// (i.e., paths starting with `#/components`). Returns `None` for external
/// references or invalid paths.
///
/// In OpenAPI specifications, the `$ref` keyword uses JSON Pointer syntax
/// to reference reusable components. Internal references within the same
/// document use the `#/components/` prefix followed by the component type and
/// name (e.g., `#/components/schemas/User`).
/// Extracts the schema name from an [`ObjectOrReference`] variant.
///
/// Returns [`Some`] with the schema name if the object is a reference
/// ([`ObjectOrReference::Ref`]) to an internal component. Returns [`None`]
/// if the object is an inline schema ([`ObjectOrReference::Object`]) or if
/// the reference points to an external document.
///
/// This is a convenience wrapper around [`parse_schema_ref_path`] that
/// handles the common case where you have an [`ObjectOrReference<ObjectSchema>`]
/// and need to determine if it references a named component.
/// Extracts a union fingerprint from a slice of schema references.
///
/// Collects all named schema references into a sorted set for union deduplication.
/// This is used to identify union types (oneOf/anyOf) that share the same set of variants.
/// Maps union type fingerprints to generated type names.
///
/// Union types (e.g., `oneOf` or `anyOf` in OpenAPI) that contain the same set of
/// schema references are identified by a fingerprint. This type maps those
/// fingerprints to stable names, ensuring consistent type generation across the API.
pub type UnionFingerprints = ;
/// Builds union fingerprints from a collection of schemas.
///
/// Scans all schemas for `oneOf` and `anyOf` compositions and creates a mapping
/// from the set of referenced schema names to the parent schema name. This enables
/// deduplication of union types that share the same set of variants.
///
/// Only unions with 2 or more named references are included.