ATLexiconTools

0.1.0

A Swift package for parsing, modelling, registering, and validating Lexicon schemas and runtime data across the AT Protocol.
ATProtoKit/ATLexiconTools

What's New

v0.1.0

2026-04-03T15:08:02Z

This is the first release of ATIdentityTools.

Once again, thank you for your support. Please give feedback, bug reports, and contributions if you have time. Consider starring this project if you find it helpful, and feel free to donate an amount that reflects the value it has brought to you. Your support helps ensure the continued development and improvement of this project. You can also speak to me on Bluesky (@cjrriley.ca) for any questions.

An icon for ATLexiconTools, which contains three stacks of rounded rectangles in an isometric top view. At the top stack, there's an at symbol in a thick weight, with a pointed arrow at the tip. The at symbol is inside of an orange puzzle piece, which is on top of a red background. The three stacks are, from top to bottom, red, orange, and blue.

ATLexiconTools

Lexicon utilities for the AT Protocol, written in Swift.

GitHub Repo stars

Static Badge GitHub Sponsors

ATLexiconTools is a Swift package for parsing, modeling, and validating AT Protocol Lexicons. It helps you work with repository records, XRPC endpoints, and subscription messages using strongly typed Swift structures instead of raw JSON.

The package is designed to make schema-aware development easier by letting you define Lexicons in code, register and resolve schema references, and validat erecords, query parameters, and request or response payloads against the AT Protocol specifications.

This Swift package mainly focuses on the syntax validation side of the AT Protocol. This is based on the lexicon package from the official atproto TypeScript repository.

Quick Example

import ATLexiconTools

do {
    let schema = """
            {
                "lexicon": 1,
                "id": "com.example.kitchenSink",
                "defs": {
                    // ...
                }
            }
            """

    let lexicon = try LexiconParser.parseLexicon(schema)
    let registry = try LexiconRegistry(lexicons: [lexicon])
    
    _ = try registry.validateRecord(by: "com.example.profile", value: .object(["$type": "com.example.profile", ...])
    _ = try registry.validateXRPCParameters(by: "com.example.query", value: ...)
    _ = try registry.validateXRPCInput(by: "com.example.procedure", value: ...)
    _ = try registry.validateXRPCOutput(by: "com.example.query", value: ...)
)
} catch {
    print(error)
}

Requirements

To use ATLexiconTools in your apps, your app should target the specific version numbers:

  • iOS and iPadOS 15 or later.
  • macOS 13 or later.
  • tvOS 14 or later.
  • visionOS 1 or later.
  • watchOS 9 or later.

On Linux, the minimum requirements include:

  • Amazon Linux 2
  • Debian 12
  • Fedora 39
  • Red Hat UBI 9
  • Ubuntu 20.04

For Android, you'll need Swift 6.1 or later. On Android, the minimum requirements include:

  • Android 10 or later.
  • Android SDK version 29 or later.

At the moment, Android is in its experimental phase. Plans to take it out of this phase will require testing all parts of the package.

You can also use this project for any programs you make using Swift and running on Docker.

Submitting Contributions and Feedback

While this project will change significantly, feedback, issues, and contributions are highly welcomed and encouraged. If you'd like to contribute to this project, please be sure to read both the API Guidelines as well as the Contributor Guidelines before submitting a pull request. Any issues (such as bug reports or feedback) can be submitted in the Issues tab. Finally, if there are any security vulnerabilities, please read SECURITY.md for how to report it.

If you have any questions, you can ask me on Bluesky (@cjrriley.ca). And while you're at it, give me a follow! I'm also active on the Bluesky API Touchers Discord server.

License

This Swift package is using the Apache 2.0 License. Please view LICENSE.md for more details.

Description

  • Swift Tools 6.0.0
View More Packages from this Author

Dependencies

Last updated: Mon Jul 13 2026 14:17:26 GMT-0900 (Hawaii-Aleutian Daylight Time)