{% extends "base.html" %} {% block main_content %} {% macro fields_table(fields) %} {% if fields %} {% for f in fields %} {% endfor %}
Name Type Details
{{ f.Name }} {{ f.Type }} {% if f.Required %}(required){% elif f.Nullable %}(nullable){% endif %} {% if f.Description %}

{{ f.Description }}

{% endif %} {% if f.Type == "string" and f.SchemaString %} {% if f.SchemaString.Format %}

Syntax Format: {{ f.SchemaString.Format }}{% endif %} {% if f.SchemaString.Default %}

Default: {{ f.SchemaString.Default }}{% endif %} {% if f.SchemaString.Const %}

Constant Value: {{ f.SchemaString.Const }}{% endif %} {% if f.SchemaString.KnownValues %}

Known Values: {% for v in f.SchemaString.KnownValues %}{{ v }}, {% endfor %}{% endif %} {% if f.SchemaString.Enum %}

Enum Values: {% for v in f.SchemaString.Enum %}{{ v }}, {% endfor %}{% endif %} {% if f.SchemaString.MinGraphemes or f.SchemaString.MaxGraphemes %}

Length in Graphemes: {% if f.SchemaString.MinGraphemes %}{{ f.SchemaString.MinGraphemes }} min{% endif %} {% if f.SchemaString.MaxGraphemes %}{{ f.SchemaString.MaxGraphemes }} max{% endif %} {% endif %} {% if f.SchemaString.MinLength or f.SchemaString.MaxLength %}

Length in bytes (when UTF-8 encoded): {% if f.SchemaString.MinLength %}{{ f.SchemaString.MinLength }} min{% endif %} {% if f.SchemaString.MaxLength %}{{ f.SchemaString.MaxLength }} max{% endif %} {% endif %} {% elif f.Type == "boolean" and f.SchemaBoolean %} {% if f.SchemaBoolean.Format %}

Format: {{ f.SchemaBoolean.Format }}{% endif %} {% if f.SchemaBoolean.Default %}

Default: {{ f.SchemaBoolean.Default }}{% endif %} {% elif f.Type == "integer" and f.SchemaInteger %} {% if f.SchemaInteger.Const %}

Constant Value: {{ f.SchemaInteger.Const }}{% endif %} {% if f.SchemaInteger.Default %}

Default: {{ f.SchemaInteger.Default }}{% endif %} {% if f.SchemaInteger.Minimum %}

Minimum: {{ f.SchemaInteger.Minimum }}{% endif %} {% if f.SchemaInteger.Maximum %}

Maxumum: {{ f.SchemaInteger.Maxumum }}{% endif %} {% if f.SchemaInteger.Enum %}

Enum Values: {% for v in f.SchemaInteger.Enum %}{{ v }}, {% endfor %}{% endif %} {% elif f.Type == "bytes" and f.SchemaBytes %} {% if f.SchemaBytes.MinLength or f.SchemaString.MaxLength %}

Length in bytes (when UTF-8 encoded): {% if f.SchemaBytes.MinLength %}{{ f.SchemaString.MinLength }} min{% endif %} {% if f.SchemaBytes.MaxLength %}{{ f.SchemaString.MaxLength }} max{% endif %} {% endif %} {% elif f.Type == "blob" and f.SchemaBlob %} {% if f.SchemaBlob.Accept %}

Accepted Content Types: {% for t in f.SchemaBlob.Accept %} {{ t }} {% endfor %} {% endif %} {% if f.SchemaBlob.MaxSize %}

Max Size (bytes): {{ f.SchemaBlob.MaxSize }} {% endif %} {% elif f.Type == "ref" %}

Reference: {{ f.Ref }} {% elif f.Type == "array" %} {% if f.Min or f.Max %}

Array Length: {% if f.Min %}{{ f.Min }} min{% endif %} {% if f.Max %}{{ f.Max }} max{% endif %} {% endif %} {% if f.Items.Type == "ref" %}

Elements are of type: {{ f.Item.Ref }} {% elif f.Items.Type == "object" %}

Element Object Schema {{ fields_table(f.Items.Fields) }}
{% elif f.Items.Type == "integer" %}

Elements are integers {# TODO #} {% elif f.Items.Type == "integer" %}

Elements are CID Links {% else %}

UNHANDLED IN ARRAYS: {{ f.Items.Type }}{% endif %} {% elif f.Type == "object" %}

{{ fields_table(f.Fields) }}
{% elif f.Type == "union" %} {{ union_list(f.Items) }} {% elif f.Type == "token" %} {% elif f.Type == "null" %} {% elif f.Type == "cid-link" %} {% elif f.Type == "unknown" %} Field can contain arbitrary JSON/CBOR object data {% else %}

UNHANDLED IN FIELDS: {{ f.Type }}{% endif %}

{% else %}

No fields defined {% endif %} {% endmacro %} {% macro record_schema(def) %} {% if def.KeyType %}

Record Key Type: {{ def.KeyType }}{% endif %}

Data Fields

{{ fields_table(def.Fields) }} {% endmacro %} {% macro api_schema(def) %}

Query Parameters

{{ fields_table(def.Fields) }} {% if def.Input or def.InputEncoding %}

Request Body

{% if def.InputEncoding%}

Content Type: {{ def.InputEncoding }}{% endif %} {% if def.Input %}{{ record_schema(def.Input) }}{% endif %} {% endif %}

Response Body

{% if def.OutputEncoding%}

Content Type: {{ def.OutputEncoding }}{% endif %} {% if def.Output %}{{ record_schema(def.Output) }}{% endif %} {{ errors_table(def.Errors) }} {% endmacro %} {% macro errors_table(errors) %}

Errors

{% if errors %} {% for e in errors %} {% endfor %}
Name Description
{{ e.Name }} {{ e.Description }}
{% else %}

No error types defined {% endif %} {% endmacro %} {% macro union_list(def) %}

{% if def.Closed %}Closed Union:{% else %}Open Union:{% endif %}

{% endmacro %}

{{ lexicon.NSID }}

Domain Index: {{ lexicon.Domain }}

Crawl History {% for def in defs %}

#{{ def.Name }} - {{ def.Type }}
{% if def.Description %}

{{ def.Description }}{% endif %} {% if def.Type == "record" %}{{ record_schema(def) }} {% elif def.Type == "query" or def.Type == "procedure" %}{{ api_schema(def) }} {% elif def.Type == "subscription" %}

Query Parameters

{{ fields_table(def.Fields) }}

Message Types

{{ union_list(def) }} {% elif def.Type == "object" %}{{ record_schema(def) }} {% elif def.Type == "union" %}{{ union_list(def) }} {% elif def.Type == "token" %}

"Tokens" in atproto are simply NSID reference strings. {% elif def.Type == "unknown" %}

"Unknown" fields may contain arbitrary JSON/CBOR object as data. {% elif def.Type == "ref" %}

This definition is a pointer to: {{ def.Ref }} {% else %}UNHANDLED IN DEFS: {{ def.Type }}{% endif %}

{% endfor %} {% endblock %}