Skip to content

Commit 7d692e7

Browse files
Cinnamon spices (SchemaStore#4690)
* Added a schema for Cinnamon Spice metadata 'info.json' files * Moved catalog entry to alphabetical? order * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Added `pnpm-lock.yaml` to .gitignore to prevent accidental commiting; removed previously comitted `pnpm-lock.yaml`; removed myself from CODEOWNERS; removed `fileMatch` entries for the Cinnamon Spice `info.json` due to it being too generic; * Fix URL of $ID and matching entry in the catalog per SchemaStore#4690 (comment) --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
1 parent 100178e commit 7d692e7

File tree

11 files changed

+139
-0
lines changed

11 files changed

+139
-0
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,3 +137,6 @@ UpgradeLog*.htm
137137
# SQL Server files
138138
App_Data/*.mdf
139139
App_Data/*.ldf
140+
141+
# Lockfiles from tools other than npm
142+
pnpm-lock.yaml

src/api/json/catalog.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -545,6 +545,12 @@
545545
"fileMatch": ["buf.work.yaml"],
546546
"url": "https://json.schemastore.org/buf.work.json"
547547
},
548+
{
549+
"name": "Cinnamon Spice info.json",
550+
"description": "The 'info.json' metadata file used in Cinnamon Spice components",
551+
"fileMatch": [],
552+
"url": "https://json.schemastore.org/cinnamon-spice.info.json"
553+
},
548554
{
549555
"name": "CodeRabbit",
550556
"description": "Supercharge your entire team with AI-driven contextual feedback & smart chat",
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"$schema": "../../schemas/json/cinnamon-spice.info.json",
3+
"additional": "This is not permitter",
4+
"author": "JEleniel (https://github.com/JEleniel",
5+
"description": "Invalid JSON Test File for http://json-schema.org/cinnamon-spice.info.json",
6+
"name": "Invalid: Additional Properties are not permitted"
7+
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"$schema": "../../schemas/json/cinnamon-spice.info.json",
3+
"additional": "This is not permitter",
4+
"author": "JEleniel (https://github.com/JEleniel"
5+
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"$schema": "../../schemas/json/cinnamon-spice.info.json",
3+
"description": "Valid JSON Test File for http://json-schema.org/cinnamon-spice.info.json",
4+
"name": "Valid: All properties oneOf"
5+
}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"$schema": "../../schemas/json/cinnamon-spice.info.json"
3+
}

src/schema-validation.jsonc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -644,6 +644,9 @@
644644
"cibuildwheel.json": {
645645
"externalSchema": ["partial-cibuildwheel.json"]
646646
},
647+
"cinnamon-spice.info.json": {
648+
"externalSchema": ["base.json"]
649+
},
647650
"cirrus.json": {
648651
"unknownKeywords": ["fileMatch"]
649652
},
Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
{
2+
"$schema": "http://json-schema.org/draft-07/schema#",
3+
"$id": "https://json.schemastore.org/cinnamon-spice.info.json",
4+
"title": "Cinnamon Spice info.json schema",
5+
"description": "Schema for the info.json metadata file of a Cinnamon Spice, as documented at: <https://github.com/linuxmint/cinnamon-spices-extensions>, <https://github.com/linuxmint/cinnamon-spices-applet>, <https://github.com/linuxmint/cinnamon-spices-desklets>, and <https://github.com/linuxmint/cinnamon-spices-themes>",
6+
"oneOf": [
7+
{
8+
"$comment": "This alternative was added so that the numerous existing info.json files that only contain the 'author' property are valid.",
9+
"additionalProperties": false,
10+
"properties": {
11+
"$schema": {
12+
"description": "The JSON schema to validate the file against",
13+
"minLength": 1,
14+
"type": "string"
15+
},
16+
"author": {
17+
"description": "The primary, current author of this Cinnamon Spice; the GitHub style `Name <email> (url)` is supported",
18+
"type": "string"
19+
}
20+
},
21+
"required": ["author"],
22+
"type": "object"
23+
},
24+
{
25+
"additionalProperties": false,
26+
"properties": {
27+
"$schema": {
28+
"description": "The JSON schema to validate the file against",
29+
"minLength": 1,
30+
"type": "string"
31+
},
32+
"author": {
33+
"description": "The primary, current author of this Cinnamon Spice; the GitHub style `Name <email> (url)` is supported.",
34+
"minLength": 1,
35+
"type": "string"
36+
},
37+
"contributors": {
38+
"description": "A list of other contributors to this Cinnamon Spice; the GitHub style `Name <email> (url)` is supported.",
39+
"items": {
40+
"type": "string"
41+
},
42+
"minItems": 1,
43+
"type": "array"
44+
},
45+
"description": {
46+
"description": "A short description of this Cinnamon Spice to be displayed in the catalog",
47+
"minLength": 1,
48+
"type": "string"
49+
},
50+
"git_author": {
51+
"description": "DEPRECATED: Use the `author` field instead",
52+
"minLength": 1,
53+
"type": "string"
54+
},
55+
"license": {
56+
"$ref": "https://json.schemastore.org/base.json#/definitions/license",
57+
"description": "The license under which this Cinnamon Spice is released"
58+
},
59+
"name": {
60+
"description": "An unique name for this Cinnamon Spice",
61+
"minLength": 1,
62+
"type": "string"
63+
},
64+
"original_author": {
65+
"description": "The name of the author who originally wrote this Cinnamon Spice if it is not the same as the current `author`; the GitHub style `Name <email> (url)` is supported.",
66+
"minLength": 1,
67+
"type": "string"
68+
},
69+
"thubmnail": {
70+
"description": "DEPRECATED: The icon should be in the `icon.png` file, and the screenshot in the `screenshot.png` file",
71+
"minLength": 1,
72+
"type": "string"
73+
},
74+
"url": {
75+
"description": "The url of the home page for this Cinnamon Spice, e.g., the GitHub repository",
76+
"format": "url",
77+
"minLength": 1,
78+
"type": "string"
79+
}
80+
},
81+
"required": ["name", "description", "author"],
82+
"type": "object"
83+
}
84+
]
85+
}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"$schema": "../../schemas/json/cinnamon-spice.info.json",
3+
"author": "JEleniel (https://github.com/JEleniel)",
4+
"contributors": ["JEleniel (https://github.com/JEleniel)"],
5+
"description": "Valid JSON Test File for http://json-schema.org/cinnamon-spice.info.json",
6+
"git_author": "JEleniel (https://github.com/JEleniel)",
7+
"license": "MIT",
8+
"name": "Valid: All properties oneOf",
9+
"original_author": "JEleniel",
10+
"thubmnail": "thumbnail.png",
11+
"url": "https://json-schema.org/cinnamon-spice-info.json"
12+
}
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"$schema": "../../schemas/json/cinnamon-spice.info.json",
3+
"author": "JEleniel (https://github.com/JEleniel)"
4+
}

0 commit comments

Comments
 (0)