Expand description
AT Protocol lexicon resolution and validation library.
This library provides functionality for resolving and validating AT Protocol lexicons, which define the schema and structure of AT Protocol data.
§Overview
Lexicons in AT Protocol serve as schema definitions that describe the structure and types of data that can be stored and transmitted. This library implements the full lexicon resolution chain as specified by the AT Protocol:
- Convert NSID to DNS name with
_lexiconprefix - Perform DNS TXT lookup to get the authoritative DID
- Resolve the DID to get the DID document
- Extract PDS endpoint from the DID document
- Make XRPC call to fetch the lexicon schema
§Modules
errors: Structured error types for all lexicon operationsresolve: Core lexicon resolution implementationresolve_recursive: Recursive resolution with dependency trackingtransmogrify: Record transformation between lexicon schemas- [
compatibility]: Schema compatibility analysis (requirespanprotofeature) validation: NSID validation, parsing, and helper functions
§Example Usage
use atproto_lexicon::resolve::{DefaultLexiconResolver, LexiconResolver};
use atproto_identity::resolve::HickoryDnsResolver;
let http_client = reqwest::Client::new();
let dns_resolver = HickoryDnsResolver::create_resolver(&[]);
let resolver = DefaultLexiconResolver::new(http_client, dns_resolver);
// Resolve a lexicon
let lexicon = resolver.resolve("app.bsky.feed.post").await?;Modules§
- errors
- Error types for the atproto-lexicon crate.
- resolve
- Lexicon resolution functionality for AT Protocol.
- resolve_
recursive - Recursive lexicon resolution functionality for AT Protocol.
- transmogrify
- Record transmogrification between AT Protocol lexicon schemas.
- validation
- Lexicon validation functionality for AT Protocol.