pub struct AsyncApiRegistry { /* private fields */ }Implementations§
Source§impl AsyncApiRegistry
impl AsyncApiRegistry
pub fn new() -> Self
pub fn load( &mut self, alias: &str, location: &str, base_dir: &Path, ) -> Result<(), String>
pub fn load_from_content( &mut self, alias: &str, content: &str, is_json: bool, ) -> Result<(), String>
pub fn resolve(&self, ext_ref: &ExternalRef) -> Result<&Value, String>
pub fn resolve_ref(&self, alias: &str, pointer: &str) -> Result<&Value, String>
pub fn get_schema_for_path( &self, ext_ref: &ExternalRef, path_segments: &[PathSegment], ) -> Result<Option<Value>, String>
Sourcepub fn resolve_message<'a>(
&'a self,
doc: &EtlDocument,
msg_ref: &MessageRef,
) -> Result<Cow<'a, Value>, String>
pub fn resolve_message<'a>( &'a self, doc: &EtlDocument, msg_ref: &MessageRef, ) -> Result<Cow<'a, Value>, String>
Resolve a Message Reference (Section 5.3.4) to its AsyncAPI Message
Object-shaped value, regardless of whether it’s an External
Reference (delegates to resolve) or an Internal Reference
(#/components/messages/<id>, looked up on doc and re-shaped into
the same {name, payload, headers} envelope an External Reference
would already carry, so callers don’t need to branch on the
reference kind).
Sourcepub fn get_schema_for_message_ref(
&self,
doc: &EtlDocument,
msg_ref: &MessageRef,
path_segments: &[PathSegment],
) -> Result<Option<Value>, String>
pub fn get_schema_for_message_ref( &self, doc: &EtlDocument, msg_ref: &MessageRef, path_segments: &[PathSegment], ) -> Result<Option<Value>, String>
Like get_schema_for_path, but accepts either kind of Message
Reference (see resolve_message).
Sourcepub fn is_path_required(
&self,
doc: &EtlDocument,
msg_ref: &MessageRef,
path_segments: &[PathSegment],
) -> Result<Option<bool>, String>
pub fn is_path_required( &self, doc: &EtlDocument, msg_ref: &MessageRef, path_segments: &[PathSegment], ) -> Result<Option<bool>, String>
Whether the terminal field of path_segments is listed in its
enclosing JSON Schema’s required array — ordinary JSON Schema
semantics, used by ECEL’s defined() (spec §6.4.1) to distinguish
“always present” (advisory: defined() on it is trivially true)
from “may be absent at runtime”. Returns None if the path itself
doesn’t resolve at all (a distinct, compile-time-error case — V-208
— handled by the caller via get_schema_for_message_ref returning
None, not by this method).