feat(import): resolve references and schema composition
This commit is contained in:
@@ -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")
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user