Skip to content
This repository was archived by the owner on Jul 21, 2026. It is now read-only.

Commit 184d218

Browse files
committed
Refactor category schema: enhance descriptions for slug, name, and parentId properties for improved clarity and enforce uniqueness requirements
1 parent 668e4c6 commit 184d218

1 file changed

Lines changed: 8 additions & 3 deletions

File tree

src/schemas/category.json

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,18 +14,23 @@
1414
"type": "string",
1515
"title": "Slug",
1616
"pattern": "^[a-z0-9]+(-[a-z0-9]+)*$",
17-
"description": "URL-friendly identifier in kebab-case"
17+
"description": "URL-friendly identifier in kebab-case. Should be unique per parent (parentId + slug enforced at the DB layer)."
1818
},
1919
"name": {
2020
"type": "string",
2121
"title": "Category Name",
22-
"description": "The name of the category."
22+
"description": "The name of the category. Should be unique per parent alongside slug (enforced at the DB layer)."
23+
},
24+
"description": {
25+
"type": ["string", "null"],
26+
"title": "Description",
27+
"description": "Optional description for the category."
2328
},
2429
"parentId": {
2530
"type": ["string", "null"],
2631
"title": "Parent Category ID",
2732
"format": "uuid",
28-
"description": "The identifier of the parent category, if any. Null if the category is top-level."
33+
"description": "The identifier of the parent category, if any. Null if the category is top-level. Parents must be top-level (no deeper than two levels; enforced outside JSON Schema)."
2934
}
3035
},
3136
"required": ["slug", "name", "parentId"]

0 commit comments

Comments
 (0)