Lexgen.Lexicon (lexgen v1.0.0)
Stores information about a Lexicon source JSON file.
According to the AT Protocol Lexicon Specification:
- A Lexicon is a JSON file.
- Each Lexicon can have AT MOST one primary type.
- Each
record
and someobject
types require the use of a special$type
key. This should be the Lexicon's NSID. - References to the "main" definition of a Lexicon should always exclude the suffix (
#main
). While some scenarios accept using a suffix of#main
, some scenarios do not, but all scenarios accept omitting the suffix for a "main" definition.
Summary
Functions
Parses a Lexicon JSON string into a Lexicon struct. Also accepts a JSON-decoded map.
Parses a single definition from a Lexicon JSON file.
Parses the defs
object from a Lexicon JSON file. This assumes that defs
in the Lexicon struct is an unmodified map from the decoded JSON source.
Splits an NSID into two components: the "namespace" and the "id".
Converts an NSID into a title-cased string.
Types
Functions
Parses a Lexicon JSON string into a Lexicon struct. Also accepts a JSON-decoded map.
Parses a single definition from a Lexicon JSON file.
Parses the defs
object from a Lexicon JSON file. This assumes that defs
in the Lexicon struct is an unmodified map from the decoded JSON source.
Splits an NSID into two components: the "namespace" and the "id".
For example, app.bsky.feed.getFeed
would split into app.bsky.feed
and getFeed
.
Converts an NSID into a title-cased string.
For example, app.bsky.feed.getFeed
becomes App.Bsky.Feed.GetFeed
.