Skip to content
7 changes: 7 additions & 0 deletions .changeset/description-union-type.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
"@hypercerts-org/lexicon": minor
---

Widen description fields on activity, collection, and attachment from a bare Leaflet ref to a union of inline descriptionString and Leaflet linearDocument, with a shared def in org.hypercerts.defs.

This is technically a breaking schema change (ref → union), but not breaking for most published records, as they already include a `$type` discriminator on the description object, so existing data validates against the union without modification.
2 changes: 1 addition & 1 deletion ERD.puml
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ dataclass collection {
type?
title
shortDescription?
description? (Leaflet ref)
description?
items[]?
location?
createdAt
Expand Down
63 changes: 36 additions & 27 deletions SCHEMAS.md

Large diffs are not rendered by default.

10 changes: 7 additions & 3 deletions lexicons/org/hypercerts/claim/activity.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,13 @@
}
},
"description": {
"type": "ref",
"ref": "pub.leaflet.pages.linearDocument#main",
"description": "Rich-text description, represented as a Leaflet linear document."
"type": "union",
"refs": [
"org.hypercerts.defs#descriptionString",
"pub.leaflet.pages.linearDocument",
"com.atproto.repo.strongRef"
],
"description": "Long-form description of the activity. An inline string for plain text or markdown, a Leaflet linear document for rich-text content, or a strong reference to an external description record."
},
"image": {
"type": "union",
Expand Down
10 changes: 7 additions & 3 deletions lexicons/org/hypercerts/collection.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,13 @@
}
},
"description": {
"type": "ref",
"ref": "pub.leaflet.pages.linearDocument#main",
"description": "Rich-text description, represented as a Leaflet linear document."
"type": "union",
"refs": [
"org.hypercerts.defs#descriptionString",
"pub.leaflet.pages.linearDocument",
"com.atproto.repo.strongRef"
],
"description": "Long-form description of the collection. An inline string for plain text or markdown, a Leaflet linear document for rich-text content, or a strong reference to an external description record."
},
"avatar": {
"type": "union",
Expand Down
10 changes: 7 additions & 3 deletions lexicons/org/hypercerts/context/attachment.json
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,13 @@
}
},
"description": {
"type": "ref",
"ref": "pub.leaflet.pages.linearDocument#main",
"description": "Rich-text description, represented as a Leaflet linear document."
"type": "union",
"refs": [
"org.hypercerts.defs#descriptionString",
"pub.leaflet.pages.linearDocument",
"com.atproto.repo.strongRef"
],
"description": "Long-form description of the attachment. An inline string for plain text or markdown, a Leaflet linear document for rich-text content, or a strong reference to an external description record."
},
"location": {
"type": "ref",
Expand Down
21 changes: 21 additions & 0 deletions lexicons/org/hypercerts/defs.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,27 @@
"id": "org.hypercerts.defs",
"description": "Common type definitions used across all Hypercerts protocols.",
"defs": {
"descriptionString": {
"type": "object",
"description": "An inline long-form description as plain text or markdown, with optional rich-text annotations.",
"required": ["value"],
"properties": {
"value": {
"type": "string",
"description": "The description text (plain text or markdown).",
"maxLength": 250000,
"maxGraphemes": 25000
Comment thread
aspiers marked this conversation as resolved.
},
"facets": {
"type": "array",
"description": "Rich text annotations for the description (mentions, URLs, hashtags, etc).",
"items": {
"type": "ref",
"ref": "app.bsky.richtext.facet"
}
}
}
},
"uri": {
"type": "object",
"required": ["uri"],
Expand Down
Loading