feat: migrate protocol and HTTP to structured interface references
T-20: identify interfaces by exact scope/name pairs; add optional opaque scope_ref metadata and separate shape validation from path-dependent scope compatibility. Preserve call error precedence, strict JSON, validators and transport boundaries. Mechanically migrate consumers and document API/wire compatibility and deferred lifecycle semantics. Validation: cargo fmt --all --check; git diff --check; cargo check --workspace --all-targets; cargo test -p wip-protocol -p wip-http; cargo test --workspace (221 passing tests including doctests); cargo test --workspace --all-targets; nix develop --command cargo clippy --workspace --all-targets -- -D warnings; RUSTDOCFLAGS="-D warnings" cargo doc --workspace --no-deps. All pass. cargo/rustc 1.95.0; development-shell Clippy/rustc 1.97.1.
This commit is contained in:
@@ -97,7 +97,7 @@ fn object_fields_keep_path_context_and_optional_ref_separate() {
|
||||
let object = Object {
|
||||
name: "article".into(),
|
||||
description: None,
|
||||
interfaces: vec!["catalog-ref".into(), "audit-ref".into()],
|
||||
interfaces: vec![root_reference("catalog-ref"), root_reference("audit-ref")],
|
||||
r#ref: None,
|
||||
validator: None,
|
||||
};
|
||||
@@ -105,7 +105,10 @@ fn object_fields_keep_path_context_and_optional_ref_separate() {
|
||||
object.validate_at_path("/library/article").unwrap();
|
||||
assert_eq!(object.name, "article");
|
||||
assert_eq!(object.r#ref, None);
|
||||
assert_eq!(object.interfaces, ["catalog-ref", "audit-ref"]);
|
||||
assert_eq!(
|
||||
object.interfaces,
|
||||
[root_reference("catalog-ref"), root_reference("audit-ref")]
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
@@ -244,3 +247,10 @@ fn assert_schema_neutral(value: &Value) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fn root_reference(name: &str) -> wip_protocol::InterfaceReference {
|
||||
wip_protocol::InterfaceReference {
|
||||
scope: "/".into(),
|
||||
name: name.into(),
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user