oas-document · interop
Declared module signatures, types, configuration, and source documentation.
Source: oas/oas/oas-document/src/interop.rs. SHA-256: c63c95edc05cade79ac2ae2d901517dc8a3083e24ab61422ae6e877d27fddb43.
This source reference follows declared modules and preserves feature attributes. It includes public declarations and implementation methods in those modules. Private-module exports and trait resolution still require the compiler; not every declaration is a crate-root import. Function bodies and constant values are omitted. Source comments describe their implementation context and are not a production deployment claim.
interop::ProtocolSupport
A supported protocol with optional version and endpoint.
Examples
use oas_document::interop::ProtocolSupport;
let proto = ProtocolSupport {
protocol: "mcp".to_string(),
version: Some("2025-01".to_string()),
endpoint: Some("https://agent.acme.com/mcp".to_string()),
};#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct ProtocolSupport {
/// Protocol identifier: `"mcp"`, `"a2a"`, `"rest"`, `"graphql"`,
/// `"grpc"`, `"websocket"`, `"oas-map"`.
pub protocol: String,
/// Protocol version if applicable.
#[serde(skip_serializing_if = "Option::is_none")]
pub version: Option<String>,
/// Endpoint URL for this protocol.
#[serde(skip_serializing_if = "Option::is_none")]
pub endpoint: Option<String>
}Source line: 24.
interop::ApiSchema
An API schema reference.
Examples
use oas_document::interop::ApiSchema;
let schema = ApiSchema {
schema_type: "openapi".to_string(),
url: "https://agent.acme.com/openapi.json".to_string(),
version: Some("3.1.0".to_string()),
};#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct ApiSchema {
/// Schema format: `"openapi"`, `"asyncapi"`, `"json-schema"`,
/// `"protobuf"`, `"graphql-sdl"`.
pub schema_type: String,
/// URL to the schema document.
pub url: String,
/// Schema version.
#[serde(skip_serializing_if = "Option::is_none")]
pub version: Option<String>
}Source line: 53.
interop::InteroperabilitySection
Interoperability section of an OAS Identity Document.
Examples
use oas_document::interop::{InteroperabilitySection, ProtocolSupport, ApiSchema};
let interop = InteroperabilitySection {
protocols: vec![
ProtocolSupport {
protocol: "mcp".to_string(),
version: Some("2025-01".to_string()),
endpoint: Some("https://agent.acme.com/mcp".to_string()),
},
ProtocolSupport {
protocol: "rest".to_string(),
version: None,
endpoint: Some("https://api.acme.com/v1".to_string()),
},
],
api_schemas: vec![ApiSchema {
schema_type: "openapi".to_string(),
url: "https://api.acme.com/v1/openapi.json".to_string(),
version: Some("3.1.0".to_string()),
}],
auth_methods: vec!["did-auth".to_string(), "api-key".to_string()],
};
assert_eq!(interop.protocols.len(), 2);#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct InteroperabilitySection {
/// Protocols this entity supports.
#[serde(default, skip_serializing_if = "Vec::is_empty")]
pub protocols: Vec<ProtocolSupport>,
/// API schema references.
#[serde(default, skip_serializing_if = "Vec::is_empty")]
pub api_schemas: Vec<ApiSchema>,
/// Authentication methods accepted: `"did-auth"`, `"api-key"`,
/// `"oauth2"`, `"mtls"`, `"bearer-token"`.
#[serde(default, skip_serializing_if = "Vec::is_empty")]
pub auth_methods: Vec<String>
}Source line: 97.
interop::protocols
Standard protocol identifiers.
pub mod protocols;Source line: 113.
interop::protocols::MCP
Model Context Protocol.
pub const MCP: &str;Source line: 115.
interop::protocols::A2A
Google Agent-to-Agent protocol.
pub const A2A: &str;Source line: 117.
interop::protocols::REST
REST / HTTP API.
pub const REST: &str;Source line: 119.
interop::protocols::GRAPHQL
GraphQL API.
pub const GRAPHQL: &str;Source line: 121.
interop::protocols::GRPC
gRPC.
pub const GRPC: &str;Source line: 123.
interop::protocols::WEBSOCKET
WebSocket.
pub const WEBSOCKET: &str;Source line: 125.
interop::protocols::OAS_MAP
OAS MAP protocol suite.
pub const OAS_MAP: &str;Source line: 127.
interop::auth_methods
Standard authentication methods.
pub mod auth_methods;Source line: 131.
interop::auth_methods::DID_AUTH
pub const DID_AUTH: &str;Source line: 132.
interop::auth_methods::API_KEY
pub const API_KEY: &str;Source line: 133.
interop::auth_methods::OAUTH2
pub const OAUTH2: &str;Source line: 134.
interop::auth_methods::MTLS
pub const MTLS: &str;Source line: 135.
interop::auth_methods::BEARER_TOKEN
pub const BEARER_TOKEN: &str;Source line: 136.