Skip to content

Commit 39cec47

Browse files
committed
Initial commit
Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>
0 parents  commit 39cec47

39 files changed

Lines changed: 4588 additions & 0 deletions

.editorconfig

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# editorconfig.org
2+
root = true
3+
4+
[*]
5+
indent_style = space
6+
indent_size = 2
7+
end_of_line = lf
8+
charset = utf-8
9+
trim_trailing_whitespace = true
10+
insert_final_newline = true
11+
12+
[Makefile]
13+
indent_style = tab
14+
15+
[*.mk]
16+
indent_style = tab

.github/workflows/ci.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
name: Std
2+
3+
on:
4+
schedule:
5+
# Once per day, Monday to Friday
6+
- cron: '0 19 * * 1-5'
7+
push:
8+
branches:
9+
- main
10+
pull_request:
11+
12+
concurrency:
13+
group: std-ci-${{ github.ref }}
14+
cancel-in-progress: true
15+
16+
jobs:
17+
test:
18+
runs-on: ubuntu-latest
19+
steps:
20+
- run: sudo snap install jsonschema
21+
- run: make

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
.DS_Store

LICENSE

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
© Sourcemeta.
2+
3+
These schemas and tests are licensed solely to active paying users of the
4+
Sourcemeta Registry. Use, copying, distribution, or sublicensing by anyone not
5+
currently paying for the Sourcemeta Registry is strictly prohibited.
6+
7+
The schemas are provided "as is" without any warranty, and Sourcemeta is not
8+
liable for any damages arising from its use.

Makefile

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
JSONSCHEMA = jsonschema
2+
SHELLCHECK = shellcheck
3+
4+
# TODO: Extend `validate` to take a directory as argument
5+
SCHEMAS = $(shell find schemas/ -type f -name '*.json')
6+
7+
all:
8+
$(JSONSCHEMA) fmt conventions.json --verbose
9+
$(JSONSCHEMA) metaschema conventions.json --verbose
10+
$(JSONSCHEMA) lint conventions.json --verbose
11+
$(JSONSCHEMA) fmt --verbose
12+
$(JSONSCHEMA) metaschema --verbose
13+
$(JSONSCHEMA) validate conventions.json --verbose $(SCHEMAS)
14+
$(JSONSCHEMA) lint --verbose
15+
$(SHELLCHECK) scripts/*.sh
16+
./scripts/schemas-tests-mirror.sh
17+
$(JSONSCHEMA) test ./tests --verbose
18+
19+
.always:

README.markdown

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
Sourcemeta JSON Schema Standard Library
2+
=======================================
3+
4+
A growing collection of hand-crafted high-quality schemas by Sourcemeta.
5+
6+
> [!CAUTION]
7+
> This repository is a work-in-progress and not ready for general use yet.

conventions.json

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
{
2+
"$schema": "https://json-schema.org/draft/2020-12/schema",
3+
"type": "object",
4+
"required": [
5+
"x-license",
6+
"title",
7+
"description",
8+
"examples",
9+
"$comment",
10+
"$schema"
11+
],
12+
"properties": {
13+
"$schema": {
14+
"const": "https://json-schema.org/draft/2020-12/schema"
15+
},
16+
"$id": false,
17+
"$comment": {
18+
"$ref": "./schemas/ietf/uri/url.json"
19+
},
20+
"examples": {
21+
"type": "array",
22+
"minItems": 3
23+
},
24+
"x-license": {
25+
"const": "https://github.com/sourcemeta/std/blob/main/LICENSE"
26+
}
27+
}
28+
}

jsonschema.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"title": "The JSON Schema Standard Library",
3+
"description": "A growing collection of hand-crafted high-quality schemas by Sourcemeta",
4+
"email": "hello@sourcemeta.com",
5+
"github": "sourcemeta/std",
6+
"path": "./schemas"
7+
}
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
{
2+
"$schema": "https://json-schema.org/draft/2020-12/schema",
3+
"title": "IEEE Std 1003.1-2017 POSIX File Path (Absolute)",
4+
"description": "IEEE Std 1003.1-2017 POSIX absolute pathname",
5+
"$comment": "https://pubs.opengroup.org/onlinepubs/9699919799/",
6+
"examples": [
7+
"/",
8+
"/home/user/document.txt",
9+
"/usr/local/bin/program",
10+
"/etc/systemd/system/service.conf",
11+
"/tmp/temp_file-123.tmp"
12+
],
13+
"x-license": "https://github.com/sourcemeta/std/blob/main/LICENSE",
14+
"type": "string",
15+
"not": {
16+
"$comment": "Cannot contain null bytes",
17+
"pattern": "\u0000"
18+
},
19+
"pattern": "^/"
20+
}
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
{
2+
"$schema": "https://json-schema.org/draft/2020-12/schema",
3+
"title": "IEEE Std 1003.1-2017 POSIX File Path (Relative)",
4+
"description": "IEEE Std 1003.1-2017 POSIX relative pathname",
5+
"$comment": "https://pubs.opengroup.org/onlinepubs/9699919799/",
6+
"examples": [
7+
"",
8+
"file.txt",
9+
"documents/project/readme.md",
10+
"../config/settings.conf",
11+
".ssh/id_rsa"
12+
],
13+
"x-license": "https://github.com/sourcemeta/std/blob/main/LICENSE",
14+
"type": "string",
15+
"not": {
16+
"anyOf": [
17+
{
18+
"$comment": "Cannot contain null bytes",
19+
"pattern": "\u0000"
20+
},
21+
{
22+
"$comment": "Cannot start with slash",
23+
"pattern": "^/"
24+
}
25+
]
26+
}
27+
}

0 commit comments

Comments
 (0)