Lexicon Spec Test Fixtures#
This directory contains test fixtures organized by ATProto Lexicon specification features, not by real-world examples.
Organization#
Each subdirectory focuses on a specific feature from the Lexicon spec:
- union/ - Union type features (open, closed, variants)
- string-constraints/ - String knownValues, enum, formats
- validation/ - Constraints (min/max length/value, graphemes)
- primary-types/ - Record, query, procedure, subscription
- field-types/ - Primitive types and their features
- refs/ - Reference patterns (local, cross-namespace)
- nullable/ - Nullable field handling
- unknown/ - Unknown type usage
- tokens/ - Token definitions and usage
- binary/ - Blob and bytes types
- evolution/ - Schema evolution patterns
Purpose#
Unlike test/scenarios/atproto/ which tests real ATProto lexicons, these fixtures:
- Test each spec feature in isolation
- Demonstrate minimal, focused examples
- Serve as documentation for TypeSpec → Lexicon mappings
- Catch edge cases and corner cases in the spec
Example Structure#
Each feature directory contains:
input/*.tsp- TypeSpec definitions for that featureoutput/*.json- Expected Lexicon JSON output
Tests should be atomic and focus on one feature at a time.