Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions @/tag/emoji.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
allOf:
- $ref: "nips/nip-25/tag/emoji/schema.yaml"
2 changes: 2 additions & 0 deletions @/tag/external-content-i.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
allOf:
- $ref: "nips/nip-73/tag/i/schema.yaml"
2 changes: 2 additions & 0 deletions @/tag/external-content-k.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
allOf:
- $ref: "nips/nip-73/tag/k/schema.yaml"
2 changes: 2 additions & 0 deletions @/tag/reaction-e.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
allOf:
Copy link

Copilot AI Sep 26, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove the trailing space after the colon on line 1.

Suggested change
allOf:
allOf:

Copilot uses AI. Check for mistakes.
- $ref: "nips/nip-25/tag/e-react/schema.yaml"
37 changes: 37 additions & 0 deletions nips/nip-25/kind-17/schema.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
$schema: http://json-schema.org/draft-07/schema#
title: kind17
description: Reaction event referencing external content (NIP-25 + NIP-73)
allOf:
- $ref: "@/note.yaml"
- type: object
properties:
kind:
const: 17
content:
type: string
description: Reaction marker such as "+", "-", or an emoji
tags:
type: array
minItems: 1
items:
allOf:
- $ref: "@/tag.yaml"
- if:
type: array
minItems: 1
items:
- const: "emoji"
then:
$ref: "@/tag/emoji.yaml"
allOf:
- contains:
$ref: "@/tag/external-content-k.yaml"
errorMessage:
contains: "tags must include at least one k tag describing the external content type"
- contains:
$ref: "@/tag/external-content-i.yaml"
errorMessage:
contains: "tags must include at least one i tag referencing the external content"
Comment on lines +29 to +34
Copy link

Copilot AI Oct 9, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The error messages are nested under individual 'contains' constraints, but this structure may not work as expected in JSON Schema. Consider moving the errorMessage to the top level of the allOf block for proper error handling.

Suggested change
errorMessage:
contains: "tags must include at least one k tag describing the external content type"
- contains:
$ref: "@/tag/external-content-i.yaml"
errorMessage:
contains: "tags must include at least one i tag referencing the external content"
- contains:
$ref: "@/tag/external-content-i.yaml"
errorMessage:
allOf:
- "tags must include at least one k tag describing the external content type"
- "tags must include at least one i tag referencing the external content"

Copilot uses AI. Check for mistakes.
required:
- kind
- tags
42 changes: 42 additions & 0 deletions nips/nip-25/kind-7/schema.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
$schema: http://json-schema.org/draft-07/schema#
title: kind7
description: Reaction event referencing a nostr event (NIP-25)
allOf:
- $ref: "@/note.yaml"
- type: object
properties:
kind:
const: 7
content:
type: string
description: "Reaction marker such as '+', '-', an emoji, or a custom :shortcode:"
tags:
type: array
minItems: 1
items:
allOf:
- $ref: "@/tag.yaml"
- if:
type: array
minItems: 1
items:
- const: "emoji"
then:
$ref: "@/tag/emoji.yaml"
contains:
$ref: "@/tag/reaction-e.yaml"
allOf:
- if:
contains:
type: array
minItems: 1
items:
- const: "emoji"
then:
contains:
$ref: "@/tag/emoji.yaml"
Comment on lines +28 to +37
Copy link

Copilot AI Sep 26, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This validation logic is redundant. The emoji tag validation is already handled in the items section (lines 17-25). This duplication could cause confusion and maintenance issues.

Suggested change
allOf:
- if:
contains:
type: array
minItems: 1
items:
- const: "emoji"
then:
contains:
$ref: "@/tag/emoji.yaml"

Copilot uses AI. Check for mistakes.
errorMessage:
contains: "tags must include an e tag referencing the reacted event"
required:
- kind
- tags
20 changes: 20 additions & 0 deletions nips/nip-25/tag/e-react/schema.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
$schema: "http://json-schema.org/draft-07/schema#"
title: reactionETag
description: Event reference tag for reaction events (NIP-25)
allOf:
- $ref: "@/tag.yaml"
- type: array
minItems: 2
items:
- const: "e"
- type: string
pattern: '^[a-f0-9]{64}$'
additionalItems:
anyOf:
- type: string
pattern: '^(ws://|wss://).+$'
- $ref: "@/secp256k1.yaml"
- type: string
minLength: 1
errorMessage:
minItems: "e tag must include the event id"
20 changes: 20 additions & 0 deletions nips/nip-25/tag/emoji/schema.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
$schema: "http://json-schema.org/draft-07/schema#"
title: emojiTag
description: Custom emoji resource reference for reactions (NIP-25 / NIP-30)
allOf:
- $ref: "@/tag.yaml"
- type: array
minItems: 3
maxItems: 3
items:
- const: "emoji"
- type: string
minLength: 1
pattern: "^[0-9A-Za-z_:+-]+$"
description: Shortcode identifying the emoji without surrounding colons
- type: string
pattern: "^https?://.+"
description: HTTPS URL pointing to the emoji image
errorMessage:
minItems: "emoji tag must contain ['emoji', <shortcode>, <https url>]"
maxItems: "emoji tag must contain ['emoji', <shortcode>, <https url>]"
18 changes: 18 additions & 0 deletions nips/nip-73/tag/i/schema.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
$schema: "http://json-schema.org/draft-07/schema#"
title: externalContentIdentifierTag
description: External content identifier tag (NIP-73)
allOf:
- $ref: "@/tag.yaml"
- type: array
minItems: 2
maxItems: 3
items:
- const: "i"
- type: string
minLength: 1
description: Identifier or URI for the external resource
- type: string
pattern: "^https?://.+"
description: Optional URL pointing to the external resource
errorMessage:
minItems: "i tag must be ['i', <identifier>, ...]"
19 changes: 19 additions & 0 deletions nips/nip-73/tag/k/schema.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
$schema: "http://json-schema.org/draft-07/schema#"
title: externalContentTypeTag
description: External content type identifier tag (NIP-73)
allOf:
- $ref: "@/tag.yaml"
- type: array
minItems: 2
maxItems: 3
items:
- const: "k"
- type: string
minLength: 1
pattern: "^[A-Za-z0-9][A-Za-z0-9._+-]*(?::[A-Za-z0-9][A-Za-z0-9._+-]*)*$"
description: Type identifier for the external resource
- type: string
minLength: 1
description: Optional subtype or hint for the external resource
errorMessage:
minItems: "k tag must be ['k', <type>, ...]"