feat(import): resolve references and schema composition

This commit is contained in:
2026-08-29 08:54:26 +03:00
parent 6c2a3712d8
commit 55209a9bbc
46 changed files with 4848 additions and 437 deletions
+5 -3
View File
@@ -122,7 +122,7 @@ paths:
}
#[test]
fn keeps_references_typed_without_resolving_them() {
fn resolves_local_references_into_typed_graph() {
let ir = normalize_document(SWAGGER2, &NormalizationConfig::default()).unwrap();
let operation = &ir.operations[0];
assert!(matches!(
@@ -130,13 +130,15 @@ paths:
.response_schema
.as_ref()
.map(|schema| &schema.kind),
Some(crank_import::rest::NormalizedSchemaKind::Reference { .. })
Some(crank_import::rest::NormalizedSchemaKind::Object { .. })
));
assert!(ir.unresolved_references.is_empty());
assert!(!ir.reference_graph.edges.is_empty());
assert!(
operation
.findings
.iter()
.any(|finding| finding.code == "unresolved_reference")
.all(|finding| finding.code != "unresolved_reference")
);
}