Skip to content

Commit 76f189c

Browse files
authored
Cover ISO 4217 currency codes (#5)
Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>
1 parent b924695 commit 76f189c

40 files changed

+8659
-4
lines changed

Makefile

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
JSONSCHEMA = jsonschema
22
SHELLCHECK = shellcheck
3+
PYTHON = python3
34

45
# TODO: Extend `validate` to take a directory as argument
56
SCHEMAS = $(shell find schemas/ -type f -name '*.json')
@@ -22,4 +23,16 @@ lint: common
2223
test: .always
2324
$(JSONSCHEMA) test ./tests
2425

26+
generate: .always
27+
$(PYTHON) scripts/generate-iso-currency.py
28+
29+
fetch: .always
30+
$(PYTHON) scripts/fetch-xml.py \
31+
"https://www.six-group.com/dam/download/financial-information/data-center/iso-currrency/lists/list-one.xml" \
32+
> data/six-group-iso-currency.json
33+
$(PYTHON) scripts/fetch-xml.py \
34+
"https://www.six-group.com/dam/download/financial-information/data-center/iso-currrency/lists/list-three.xml" \
35+
> data/six-group-iso-currency-historical.json
36+
37+
2538
.always:

conventions.json

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,26 @@
11
{
22
"$schema": "https://json-schema.org/draft/2020-12/schema",
33
"type": "object",
4+
"anyOf": [
5+
{
6+
"properties": {
7+
"examples": {
8+
"type": "array",
9+
"minItems": 1
10+
},
11+
"const": true
12+
}
13+
},
14+
{
15+
"properties": {
16+
"examples": {
17+
"type": "array",
18+
"minItems": 3
19+
},
20+
"const": false
21+
}
22+
}
23+
],
424
"required": [
525
"x-license",
626
"title",
@@ -17,10 +37,6 @@
1737
"$comment": {
1838
"$ref": "./schemas/ietf/http/https-url.json"
1939
},
20-
"examples": {
21-
"type": "array",
22-
"minItems": 3
23-
},
2440
"x-license": {
2541
"const": "https://github.com/sourcemeta/std/blob/main/LICENSE"
2642
}

0 commit comments

Comments
 (0)