json-model-compiler 2.0.63__tar.gz → 2.0.65__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {json_model_compiler-2.0.63 → json_model_compiler-2.0.65}/BACKLOG.md +1 -16
- {json_model_compiler-2.0.63 → json_model_compiler-2.0.65}/BENCH.md +13 -3
- {json_model_compiler-2.0.63/json_model_compiler.egg-info → json_model_compiler-2.0.65}/PKG-INFO +1 -1
- {json_model_compiler-2.0.63 → json_model_compiler-2.0.65}/SPEC.md +121 -64
- {json_model_compiler-2.0.63 → json_model_compiler-2.0.65}/VERSION.md +37 -0
- {json_model_compiler-2.0.63 → json_model_compiler-2.0.65}/about.sh +1 -1
- {json_model_compiler-2.0.63 → json_model_compiler-2.0.65}/bench.sh +19 -10
- {json_model_compiler-2.0.63 → json_model_compiler-2.0.65}/json_model/analyze.py +8 -1
- json_model_compiler-2.0.65/json_model/data/VERSION +1 -0
- {json_model_compiler-2.0.63 → json_model_compiler-2.0.65}/json_model/model.py +232 -46
- {json_model_compiler-2.0.63 → json_model_compiler-2.0.65}/json_model/recurse.py +7 -2
- {json_model_compiler-2.0.63 → json_model_compiler-2.0.65/json_model_compiler.egg-info}/PKG-INFO +1 -1
- json_model_compiler-2.0.63/json_model/data/VERSION +0 -1
- {json_model_compiler-2.0.63 → json_model_compiler-2.0.65}/.github/workflows/docs.yml +0 -0
- {json_model_compiler-2.0.63 → json_model_compiler-2.0.65}/.github/workflows/sanity.yml +0 -0
- {json_model_compiler-2.0.63 → json_model_compiler-2.0.65}/.gitignore +0 -0
- {json_model_compiler-2.0.63 → json_model_compiler-2.0.65}/.gitmodules +0 -0
- {json_model_compiler-2.0.63 → json_model_compiler-2.0.65}/API.md +0 -0
- {json_model_compiler-2.0.63 → json_model_compiler-2.0.65}/COMP.md +0 -0
- {json_model_compiler-2.0.63 → json_model_compiler-2.0.65}/DESIGN.md +0 -0
- {json_model_compiler-2.0.63 → json_model_compiler-2.0.65}/DEV.md +0 -0
- {json_model_compiler-2.0.63 → json_model_compiler-2.0.65}/DOC.md +0 -0
- {json_model_compiler-2.0.63 → json_model_compiler-2.0.65}/HOWTO.md +0 -0
- {json_model_compiler-2.0.63 → json_model_compiler-2.0.65}/INTEGRATION.md +0 -0
- {json_model_compiler-2.0.63 → json_model_compiler-2.0.65}/MANIFEST.in +0 -0
- {json_model_compiler-2.0.63 → json_model_compiler-2.0.65}/Makefile +0 -0
- {json_model_compiler-2.0.63 → json_model_compiler-2.0.65}/PUBS.md +0 -0
- {json_model_compiler-2.0.63 → json_model_compiler-2.0.65}/README.md +0 -0
- {json_model_compiler-2.0.63 → json_model_compiler-2.0.65}/TUTO.md +0 -0
- {json_model_compiler-2.0.63 → json_model_compiler-2.0.65}/json_model/README.md +0 -0
- {json_model_compiler-2.0.63 → json_model_compiler-2.0.65}/json_model/__init__.py +0 -0
- {json_model_compiler-2.0.63 → json_model_compiler-2.0.65}/json_model/clang.py +0 -0
- {json_model_compiler-2.0.63 → json_model_compiler-2.0.65}/json_model/convert.py +0 -0
- {json_model_compiler-2.0.63 → json_model_compiler-2.0.65}/json_model/data/clang_entry.c +0 -0
- {json_model_compiler-2.0.63 → json_model_compiler-2.0.65}/json_model/data/clang_free.c +0 -0
- {json_model_compiler-2.0.63 → json_model_compiler-2.0.65}/json_model/data/clang_init.c +0 -0
- {json_model_compiler-2.0.63 → json_model_compiler-2.0.65}/json_model/data/clang_pcre2_fun.c +0 -0
- {json_model_compiler-2.0.63 → json_model_compiler-2.0.65}/json_model/data/clang_re2_fun.c +0 -0
- {json_model_compiler-2.0.63 → json_model_compiler-2.0.65}/json_model/data/java_free.java +0 -0
- {json_model_compiler-2.0.63 → json_model_compiler-2.0.65}/json_model/data/java_init.java +0 -0
- {json_model_compiler-2.0.63 → json_model_compiler-2.0.65}/json_model/data/javascript_exe.js +0 -0
- {json_model_compiler-2.0.63 → json_model_compiler-2.0.65}/json_model/data/javascript_foot.js +0 -0
- {json_model_compiler-2.0.63 → json_model_compiler-2.0.65}/json_model/data/javascript_free.js +0 -0
- {json_model_compiler-2.0.63 → json_model_compiler-2.0.65}/json_model/data/javascript_head.js +0 -0
- {json_model_compiler-2.0.63 → json_model_compiler-2.0.65}/json_model/data/javascript_init.js +0 -0
- {json_model_compiler-2.0.63 → json_model_compiler-2.0.65}/json_model/data/javascript_main.js +0 -0
- {json_model_compiler-2.0.63 → json_model_compiler-2.0.65}/json_model/data/jmc.pod +0 -0
- {json_model_compiler-2.0.63 → json_model_compiler-2.0.65}/json_model/data/perl_entry.pl +0 -0
- {json_model_compiler-2.0.63 → json_model_compiler-2.0.65}/json_model/data/perl_exe.pl +0 -0
- {json_model_compiler-2.0.63 → json_model_compiler-2.0.65}/json_model/data/perl_free.pl +0 -0
- {json_model_compiler-2.0.63 → json_model_compiler-2.0.65}/json_model/data/perl_init.pl +0 -0
- {json_model_compiler-2.0.63 → json_model_compiler-2.0.65}/json_model/data/perl_main.pl +0 -0
- {json_model_compiler-2.0.63 → json_model_compiler-2.0.65}/json_model/data/perl_pkg.pl +0 -0
- {json_model_compiler-2.0.63 → json_model_compiler-2.0.65}/json_model/data/plpgsql_entry.sql +0 -0
- {json_model_compiler-2.0.63 → json_model_compiler-2.0.65}/json_model/data/python_entry.py +0 -0
- {json_model_compiler-2.0.63 → json_model_compiler-2.0.65}/json_model/data/python_exe.py +0 -0
- {json_model_compiler-2.0.63 → json_model_compiler-2.0.65}/json_model/data/python_free.py +0 -0
- {json_model_compiler-2.0.63 → json_model_compiler-2.0.65}/json_model/data/python_init.py +0 -0
- {json_model_compiler-2.0.63 → json_model_compiler-2.0.65}/json_model/data/python_main.py +0 -0
- {json_model_compiler-2.0.63 → json_model_compiler-2.0.65}/json_model/export.py +0 -0
- {json_model_compiler-2.0.63 → json_model_compiler-2.0.65}/json_model/irep.py +0 -0
- {json_model_compiler-2.0.63 → json_model_compiler-2.0.65}/json_model/iroptim.py +0 -0
- {json_model_compiler-2.0.63 → json_model_compiler-2.0.65}/json_model/java.py +0 -0
- {json_model_compiler-2.0.63 → json_model_compiler-2.0.65}/json_model/javascript.py +0 -0
- {json_model_compiler-2.0.63 → json_model_compiler-2.0.65}/json_model/language.py +0 -0
- {json_model_compiler-2.0.63 → json_model_compiler-2.0.65}/json_model/mtypes.py +0 -0
- {json_model_compiler-2.0.63 → json_model_compiler-2.0.65}/json_model/objops.py +0 -0
- {json_model_compiler-2.0.63 → json_model_compiler-2.0.65}/json_model/optim.py +0 -0
- {json_model_compiler-2.0.63 → json_model_compiler-2.0.65}/json_model/perl.py +0 -0
- {json_model_compiler-2.0.63 → json_model_compiler-2.0.65}/json_model/plpgsql.py +0 -0
- {json_model_compiler-2.0.63 → json_model_compiler-2.0.65}/json_model/predefs.py +0 -0
- {json_model_compiler-2.0.63 → json_model_compiler-2.0.65}/json_model/python.py +0 -0
- {json_model_compiler-2.0.63 → json_model_compiler-2.0.65}/json_model/regex.py +0 -0
- {json_model_compiler-2.0.63 → json_model_compiler-2.0.65}/json_model/resolver.py +0 -0
- {json_model_compiler-2.0.63 → json_model_compiler-2.0.65}/json_model/runtime/Makefile +0 -0
- {json_model_compiler-2.0.63 → json_model_compiler-2.0.65}/json_model/runtime/__init__.py +0 -0
- {json_model_compiler-2.0.63 → json_model_compiler-2.0.65}/json_model/runtime/c/Makefile +0 -0
- {json_model_compiler-2.0.63 → json_model_compiler-2.0.65}/json_model/runtime/c/json-model.c +0 -0
- {json_model_compiler-2.0.63 → json_model_compiler-2.0.65}/json_model/runtime/c/json-model.h +0 -0
- {json_model_compiler-2.0.63 → json_model_compiler-2.0.65}/json_model/runtime/c/main.c +0 -0
- {json_model_compiler-2.0.63 → json_model_compiler-2.0.65}/json_model/runtime/java/.gitignore +0 -0
- {json_model_compiler-2.0.63 → json_model_compiler-2.0.65}/json_model/runtime/java/Makefile +0 -0
- {json_model_compiler-2.0.63 → json_model_compiler-2.0.65}/json_model/runtime/java/README.md +0 -0
- {json_model_compiler-2.0.63 → json_model_compiler-2.0.65}/json_model/runtime/java/env.sh +0 -0
- {json_model_compiler-2.0.63 → json_model_compiler-2.0.65}/json_model/runtime/java/json_model/Checker.java +0 -0
- {json_model_compiler-2.0.63 → json_model_compiler-2.0.65}/json_model/runtime/java/json_model/GSON.java +0 -0
- {json_model_compiler-2.0.63 → json_model_compiler-2.0.65}/json_model/runtime/java/json_model/JSON.java +0 -0
- {json_model_compiler-2.0.63 → json_model_compiler-2.0.65}/json_model/runtime/java/json_model/JSONP.java +0 -0
- {json_model_compiler-2.0.63 → json_model_compiler-2.0.65}/json_model/runtime/java/json_model/Jackson.java +0 -0
- {json_model_compiler-2.0.63 → json_model_compiler-2.0.65}/json_model/runtime/java/json_model/Main.java +0 -0
- {json_model_compiler-2.0.63 → json_model_compiler-2.0.65}/json_model/runtime/java/json_model/ModelChecker.java +0 -0
- {json_model_compiler-2.0.63 → json_model_compiler-2.0.65}/json_model/runtime/java/json_model/Path.java +0 -0
- {json_model_compiler-2.0.63 → json_model_compiler-2.0.65}/json_model/runtime/java/json_model/Report.java +0 -0
- {json_model_compiler-2.0.63 → json_model_compiler-2.0.65}/json_model/runtime/java/json_model/Runtime.java +0 -0
- {json_model_compiler-2.0.63 → json_model_compiler-2.0.65}/json_model/runtime/java/pom.xml +0 -0
- {json_model_compiler-2.0.63 → json_model_compiler-2.0.65}/json_model/runtime/js/README.md +0 -0
- {json_model_compiler-2.0.63 → json_model_compiler-2.0.65}/json_model/runtime/js/index.js +0 -0
- {json_model_compiler-2.0.63 → json_model_compiler-2.0.65}/json_model/runtime/js/main.js +0 -0
- {json_model_compiler-2.0.63 → json_model_compiler-2.0.65}/json_model/runtime/js/package.json +0 -0
- {json_model_compiler-2.0.63 → json_model_compiler-2.0.65}/json_model/runtime/pl/.gitignore +0 -0
- {json_model_compiler-2.0.63 → json_model_compiler-2.0.65}/json_model/runtime/pl/Changes +0 -0
- {json_model_compiler-2.0.63 → json_model_compiler-2.0.65}/json_model/runtime/pl/LICENSE +0 -0
- {json_model_compiler-2.0.63 → json_model_compiler-2.0.65}/json_model/runtime/pl/MANIFEST +0 -0
- {json_model_compiler-2.0.63 → json_model_compiler-2.0.65}/json_model/runtime/pl/Makefile.PL +0 -0
- {json_model_compiler-2.0.63 → json_model_compiler-2.0.65}/json_model/runtime/pl/README +0 -0
- {json_model_compiler-2.0.63 → json_model_compiler-2.0.65}/json_model/runtime/pl/env.sh +0 -0
- {json_model_compiler-2.0.63 → json_model_compiler-2.0.65}/json_model/runtime/pl/ignore.txt +0 -0
- {json_model_compiler-2.0.63 → json_model_compiler-2.0.65}/json_model/runtime/pl/lib/JSON/JsonModel.pm +0 -0
- {json_model_compiler-2.0.63 → json_model_compiler-2.0.65}/json_model/runtime/pl/t/00-load.t +0 -0
- {json_model_compiler-2.0.63 → json_model_compiler-2.0.65}/json_model/runtime/pl/t/manifest.t +0 -0
- {json_model_compiler-2.0.63 → json_model_compiler-2.0.65}/json_model/runtime/pl/t/pod-coverage.t +0 -0
- {json_model_compiler-2.0.63 → json_model_compiler-2.0.65}/json_model/runtime/pl/t/pod.t +0 -0
- {json_model_compiler-2.0.63 → json_model_compiler-2.0.65}/json_model/runtime/pl/xt/boilerplate.t +0 -0
- {json_model_compiler-2.0.63 → json_model_compiler-2.0.65}/json_model/runtime/sql/META.json +0 -0
- {json_model_compiler-2.0.63 → json_model_compiler-2.0.65}/json_model/runtime/sql/Makefile +0 -0
- {json_model_compiler-2.0.63 → json_model_compiler-2.0.65}/json_model/runtime/sql/json_model--2.0.sql +0 -0
- {json_model_compiler-2.0.63 → json_model_compiler-2.0.65}/json_model/runtime/sql/json_model.control +0 -0
- {json_model_compiler-2.0.63 → json_model_compiler-2.0.65}/json_model/runtime/support.py +0 -0
- {json_model_compiler-2.0.63 → json_model_compiler-2.0.65}/json_model/runtime/types.py +0 -0
- {json_model_compiler-2.0.63 → json_model_compiler-2.0.65}/json_model/script.py +0 -0
- {json_model_compiler-2.0.63 → json_model_compiler-2.0.65}/json_model/submodel.py +0 -0
- {json_model_compiler-2.0.63 → json_model_compiler-2.0.65}/json_model/ts_export.py +0 -0
- {json_model_compiler-2.0.63 → json_model_compiler-2.0.65}/json_model/url_cache.py +0 -0
- {json_model_compiler-2.0.63 → json_model_compiler-2.0.65}/json_model/utils.py +0 -0
- {json_model_compiler-2.0.63 → json_model_compiler-2.0.65}/json_model/xstatic.py +0 -0
- {json_model_compiler-2.0.63 → json_model_compiler-2.0.65}/json_model_compiler.egg-info/SOURCES.txt +0 -0
- {json_model_compiler-2.0.63 → json_model_compiler-2.0.65}/json_model_compiler.egg-info/dependency_links.txt +0 -0
- {json_model_compiler-2.0.63 → json_model_compiler-2.0.65}/json_model_compiler.egg-info/entry_points.txt +0 -0
- {json_model_compiler-2.0.63 → json_model_compiler-2.0.65}/json_model_compiler.egg-info/not-zip-safe +0 -0
- {json_model_compiler-2.0.63 → json_model_compiler-2.0.65}/json_model_compiler.egg-info/requires.txt +0 -0
- {json_model_compiler-2.0.63 → json_model_compiler-2.0.65}/json_model_compiler.egg-info/top_level.txt +0 -0
- {json_model_compiler-2.0.63 → json_model_compiler-2.0.65}/package.json +0 -0
- {json_model_compiler-2.0.63 → json_model_compiler-2.0.65}/pyproject.toml +0 -0
- {json_model_compiler-2.0.63 → json_model_compiler-2.0.65}/setup.cfg +0 -0
|
@@ -3,8 +3,6 @@
|
|
|
3
3
|
## Current Tasks
|
|
4
4
|
|
|
5
5
|
- [ ] java-runtime: consider automatic updates?
|
|
6
|
-
- [ ] bench: re-build corvus image automatically
|
|
7
|
-
- [ ] bench: run cron bench with corvus (wip)
|
|
8
6
|
- [ ] pr: improve compiler page, list and describe optimizations?
|
|
9
7
|
- [ ] bench: better count should ignore bads
|
|
10
8
|
- [ ] bench: handle case failures for radar (wip, ajv handling)
|
|
@@ -24,7 +22,6 @@
|
|
|
24
22
|
- [ ] front: generate valid minimal, maximal and random values from a model
|
|
25
23
|
- [ ] front: generate invalid minimal values from a model
|
|
26
24
|
- [ ] optim: collect and display stats about what works
|
|
27
|
-
- [ ] spec: allow to _remove_ definitions, eg `{ "$stuff": {"/": "$foo"}}`
|
|
28
25
|
- [ ] spec: restrict regex syntax to a smaller subset
|
|
29
26
|
- [ ] perf: drop and/or merge identical results when comparing
|
|
30
27
|
- [ ] backend: check `mv-34/mu` test case which may require some utf normalization
|
|
@@ -52,7 +49,6 @@
|
|
|
52
49
|
- [ ] predefs: _url_ vs _uri_ vs _iri_
|
|
53
50
|
- [ ] predefs: improve `$URI` and `$URL`
|
|
54
51
|
- [ ] predefs: add `$SIMPLE_REGEX` for regex syntax subset?
|
|
55
|
-
- [ ] docker: enable user remap
|
|
56
52
|
- [ ] export: java classes
|
|
57
53
|
- [ ] export: go interfaces
|
|
58
54
|
- [ ] export: ts interfaces
|
|
@@ -113,19 +109,8 @@
|
|
|
113
109
|
- [ ] predefs: add country codes, eg `$COUNTRY $COUNTRY2 $COUNTRY3 $COUNTRYN`
|
|
114
110
|
- [ ] spec: be precise about predefs standard references, eg `$DATE` and co.
|
|
115
111
|
|
|
116
|
-
## Internship
|
|
112
|
+
## Internship Ideas
|
|
117
113
|
|
|
118
|
-
- [x] pr: read www, papers, spec… setup dev env, report issues
|
|
119
|
-
- [x] pr: try tutorial, report issues and suggest improvements
|
|
120
|
-
- [x] tests: add a few tests for jsonrpc model
|
|
121
|
-
- [x] model: write a model for MCP
|
|
122
|
-
- [x] tests: add a few tests for MCP model
|
|
123
|
-
- [x] export: generate ts interfaces
|
|
124
|
-
- [x] model: fix IR model and tests
|
|
125
|
-
- [x] front: IR re-entrance
|
|
126
|
-
- [ ] tests: generate valid (pseudo-random) values
|
|
127
|
-
- [ ] tests: generate invalid minimal, maximal, pseudo-random values
|
|
128
|
-
- [ ] tests: generate invalid values on each constraint
|
|
129
114
|
- [ ] backend: C and runtime with json-c (\*, but beware of runtime integration)
|
|
130
115
|
- [ ] backend: C# (\*\*)
|
|
131
116
|
- [ ] backend: go (\*\*\*)
|
|
@@ -60,14 +60,16 @@ differences in the validated results, in which case they are manually
|
|
|
60
60
|
validated and discussed.
|
|
61
61
|
|
|
62
62
|
- Performance elapsed times for each test are collected over a loop to compute
|
|
63
|
-
an average and standard deviation.
|
|
64
|
-
such as JIT compilation, GC runs and
|
|
63
|
+
an average and standard deviation.
|
|
64
|
+
The repetition also intends to catch hidden costs such as JIT compilation, GC runs and
|
|
65
|
+
lazy initializations, amortized over the loop and tests, typically _1,000,000_ validations
|
|
66
|
+
for a _1000_ iteration loop over _1000_ test values.
|
|
65
67
|
- Several independent runs are performed to reduce host load effects.
|
|
66
68
|
- Compilation times and performance times are the _median_ encountered over the runs.
|
|
67
69
|
- Runs are usually performed in _fast_ mode: the rejection reasons are not collected,
|
|
68
70
|
and the run stops as soon as possible.
|
|
69
71
|
- The benchmark presents relative comparison ratios to smooth out the wide range of
|
|
70
|
-
collected performances (from 10 ns to over 300 µs for validating one value).
|
|
72
|
+
collected performances (from 10 ns to over 300 µs for validating one test value).
|
|
71
73
|
|
|
72
74
|
Note that performance figures **must** be taken with a pinch of salt, please consider
|
|
73
75
|
the following caveats, and others:
|
|
@@ -84,6 +86,14 @@ the following caveats, and others:
|
|
|
84
86
|
so it is often disabled.
|
|
85
87
|
- The measure overhead is estimated and deduced from the performance figures by default,
|
|
86
88
|
which leads to potentially fuzzy results when testing very small values.
|
|
89
|
+
- Parsing is not taken into account:
|
|
90
|
+
From a user perspective, the combined time for parsing or building, checking, and
|
|
91
|
+
using or serializing makes more sense.
|
|
92
|
+
From our tool perspective, it is built around external representations, and
|
|
93
|
+
aims at being _inserted_ into existing code, without changing the underlying
|
|
94
|
+
JSON libraries, so the validation is the only new overhead to consider.
|
|
95
|
+
For other tools which force using their own representation (eg Blaze or Corvus C#)
|
|
96
|
+
and may imply conversion costs, an end-to-end measure seems more appropriate.
|
|
87
97
|
- Compilers, libraries and other design and updates can have dramatic effects:
|
|
88
98
|
for faster parsing, a library may use linked-list for properties, which means
|
|
89
99
|
that retrieving a given property value will cost more than a library which uses
|
|
@@ -146,7 +146,7 @@ for all possible values for that type.
|
|
|
146
146
|
- `"$IP6"`: an ipv6, eg _0::0_
|
|
147
147
|
- `"$ETH"`: an ethernet (mac) address, eg _De:ad:Be:ef:01:23_
|
|
148
148
|
- `"$CARD"`: a credit card number with a Luhn checksum, eg _1234567890123452_
|
|
149
|
-
- `"$JSONPT"`: an RFC6901 json pointer, eg _/http
|
|
149
|
+
- `"$JSONPT"`: an RFC6901 json pointer, eg _/http:\~1\~1json-model.org_
|
|
150
150
|
- `"$TIMETZ"`: time with timezone
|
|
151
151
|
- `"$SEMVER"`: semantic versioning 2.0
|
|
152
152
|
|
|
@@ -458,90 +458,147 @@ A reference is a string which begins with the `$` character.
|
|
|
458
458
|
|
|
459
459
|
Implementation should detect external reference cycles which are errors and should be rejected.
|
|
460
460
|
|
|
461
|
-
## (EXPERIMENTAL) Model Transformations
|
|
461
|
+
## (EXPERIMENTAL) Type Edition (aka Model Transformations)
|
|
462
462
|
|
|
463
|
-
|
|
463
|
+
Type edition allows to transform models by editing nodes inside a model.
|
|
464
|
+
It comes in two forms:
|
|
465
|
+
|
|
466
|
+
1. Global Type Edition with special keyword `%` at the root of the model.
|
|
467
|
+
2. Local Type Edition within `$`-definitions.
|
|
468
|
+
|
|
469
|
+
The are executed when the model is loaded, as an initial syntactic step,
|
|
470
|
+
before any interpretation of the model beside considering its definitions `$`
|
|
471
|
+
and editions `%`.
|
|
472
|
+
|
|
473
|
+
### Global Type Editions
|
|
474
|
+
|
|
475
|
+
Symbol `%` at the root of the model defines a global type edition object, which
|
|
464
476
|
may include symbol renamings, model importations and model editions.
|
|
477
|
+
Inside the type edition objects, `#...` properties are comments to be ignored.
|
|
478
|
+
Other allowed properties are imports (`<`) and references (`$...`).
|
|
479
|
+
Any other property is an error.
|
|
465
480
|
|
|
466
|
-
- **
|
|
481
|
+
- **Importation**
|
|
467
482
|
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
483
|
+
Special property `<` inside a edition object expects a reference to an external model,
|
|
484
|
+
or a list of such references, and imports all **definitions** of the targets into the
|
|
485
|
+
local scope, as local **definitions**.
|
|
471
486
|
|
|
472
|
-
|
|
473
|
-
{
|
|
474
|
-
"%": { ".com": "#", ".or": "|", ".merge": "+" }
|
|
475
|
-
}
|
|
476
|
-
```
|
|
487
|
+
While importing, homonymous definitions are invalid and must be rejected.
|
|
477
488
|
|
|
478
|
-
|
|
489
|
+
- **Model Removal, Addition and Edition**
|
|
479
490
|
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
491
|
+
Model editions are specified with properties which are references (`$...`) possibly followed
|
|
492
|
+
by a JSON path, allowing to point to a JSON element in the model, and either a value
|
|
493
|
+
with special properties `/ *` to remove or add sub elements, `:` to rename properties.
|
|
494
|
+
Anything else taken as-is, but which must not be an object with any of the special properties.
|
|
483
495
|
|
|
484
|
-
|
|
496
|
+
- If the reference ends with `#`, it designates the model _definitions_ on which the
|
|
497
|
+
editions are performed. The reference object must be a root model, eg imported with
|
|
498
|
+
a URL (`{ "model": "$https://json-model/models/json-model" }`). `$#` is a reference
|
|
499
|
+
to a model's own definitions. A reference may designate an indirectly imported model,
|
|
500
|
+
eg `$openapi#schema#` where `schema` is a definition inside `openapi`.
|
|
501
|
+
If the referenced object does not exist, this is an error.
|
|
485
502
|
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
```
|
|
503
|
+
The target value may contains any of `/ * ~` properties, this is a type edition object,
|
|
504
|
+
which is interpreted as follow, in this order, when they exist:
|
|
489
505
|
|
|
490
|
-
|
|
491
|
-
|
|
506
|
+
`/` must be a string or list of strings, the corresponding definitions must exist and
|
|
507
|
+
are removed.
|
|
492
508
|
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
This feature allow the localization of the model syntax.
|
|
509
|
+
`*` is a object containing new definitions to be added to the name space. If
|
|
510
|
+
the name already exists, this is an error.
|
|
496
511
|
|
|
497
|
-
-
|
|
512
|
+
`~` is a string-to-string map to rename definitions, which the source must exist
|
|
513
|
+
and the target must not.
|
|
514
|
+
The renaming occurs simultaneously, i.e. `{"a": "b", "b": "a"}` inverts `a`
|
|
515
|
+
and `b` values and is allowed.
|
|
498
516
|
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
local scope.
|
|
517
|
+
The target object may also include comments (`# ...` properties) which are ignored.
|
|
518
|
+
It cannot include anything else.
|
|
502
519
|
|
|
503
|
-
|
|
520
|
+
- If the reference does **not** end with a `#`, this is interpreted as a `$` reference
|
|
521
|
+
possibly followed by a simple `.`-separated JSON Path: `$Foo.?bla` is definition `Foo`
|
|
522
|
+
and within this definition property `?bla`. As expected, `$.foo` refer to property
|
|
523
|
+
`foo` at the root of the model itself.
|
|
504
524
|
|
|
505
|
-
-
|
|
525
|
+
- If the reference is a name without a path, it designates a definition.
|
|
506
526
|
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
527
|
+
If the definition does not exist, it is created and the value is associated
|
|
528
|
+
to the definition, which may be a model **or** a local type edition.
|
|
529
|
+
|
|
530
|
+
- If the definition exists, or if the reference is a name with an existing path:
|
|
531
|
+
|
|
532
|
+
- If the target value is an object which contains any of contains `/ * ~` properties
|
|
533
|
+
and possibly some comments, this is an edition, interpreted as follow:
|
|
534
|
+
|
|
535
|
+
`/` is a scalar or list of stuff and the referenced model is an array,
|
|
536
|
+
the values are removed from the array; if it is an object, the scalar or stuffs
|
|
537
|
+
must be strings, and the corresponding properties are removed. Other cases are errors.
|
|
538
|
+
|
|
539
|
+
`*` interpretation is also type dependent:
|
|
540
|
+
If a scalar and the target a list, the item must exist and is removed;
|
|
541
|
+
If a list of stuff and the target a list, the items must exist and are removed;
|
|
542
|
+
If a list of strings and the target is an objects, keep only those properties;
|
|
543
|
+
If an object and the target an object, both objects are merged,
|
|
544
|
+
with property collisions considered as errors.
|
|
545
|
+
All other cases are errors.
|
|
546
|
+
|
|
547
|
+
`~` is a string-to-string map, the target must be an object, the sources
|
|
548
|
+
must exist as properties and are renamed to the target, which must not exist.
|
|
549
|
+
The renaming occurs simultaneously, i.e. `{"a": "b", "b": "a"}` inverts `a`
|
|
550
|
+
and `b` value and is allowed.
|
|
551
|
+
|
|
552
|
+
- Otherwise the target is assumed to be a model and replaces initial definition
|
|
553
|
+
or value at the path.
|
|
554
|
+
|
|
555
|
+
- If the reference is a name with a non existing path, this is an error.
|
|
556
|
+
|
|
557
|
+
### Local Type Editions
|
|
558
|
+
|
|
559
|
+
Symbols `<`, `/`, `*`, `~` inside a _definition_ constitute a local type edition.
|
|
560
|
+
|
|
561
|
+
- `<` must be a simple local reference `$name`, the target model is **copied** inside the definition.
|
|
562
|
+
- `/`, `*` and `~` define local editions inside the definition, as describe above.
|
|
540
563
|
|
|
541
564
|
What is the _right_ balance between features, syntax and ease-of-use for a type transformation
|
|
542
565
|
language is an on-going investigation: should it allow renaming, moving or copying attributes?
|
|
543
566
|
Should it allow to remove definitions? Should imports allow to define a namespace?
|
|
544
567
|
|
|
568
|
+
Local editions are executed _after_ global editions, which may add new definitions with
|
|
569
|
+
such local editions.
|
|
570
|
+
|
|
571
|
+
## (EXPERIMENTAL) Symbol Names
|
|
572
|
+
|
|
573
|
+
Within the `%` object at the root, properties beginning with a `.` introduce new symbol names.
|
|
574
|
+
The value is the symbol string which is replaced, in `# ~ $ % @ = != <= < >= > ! | ^ & + / *`.
|
|
575
|
+
For instance:
|
|
576
|
+
|
|
577
|
+
```json
|
|
578
|
+
{
|
|
579
|
+
"%": { ".com": "#", ".or": "|", ".merge": "+" }
|
|
580
|
+
}
|
|
581
|
+
```
|
|
582
|
+
|
|
583
|
+
Declares property substitutions, which translate this model:
|
|
584
|
+
|
|
585
|
+
```json
|
|
586
|
+
{ ".merge": [ {"a": 0}, {".or": [ {"b": 0}, {"c": 0} ] } ] }
|
|
587
|
+
```
|
|
588
|
+
|
|
589
|
+
Into:
|
|
590
|
+
|
|
591
|
+
```json
|
|
592
|
+
{ "+": [ {"a": 0}, {"|": [ {"b": 0}, {"c": 0} ] } ] }
|
|
593
|
+
```
|
|
594
|
+
|
|
595
|
+
These substitutions can be carried out by a separate preprocessor which generates
|
|
596
|
+
the resulting standard model without any renamed symbol.
|
|
597
|
+
|
|
598
|
+
When declaring the model meta-model with `"~"` at the root, any renaming section specified
|
|
599
|
+
in the meta-model **must** be applied to the current model before further processing.
|
|
600
|
+
This feature allow the localization of the model syntax.
|
|
601
|
+
|
|
545
602
|
## Static Typing Lattice
|
|
546
603
|
|
|
547
604
|
In the above specification, there are several requirements for having _one_ known type
|
|
@@ -1,5 +1,42 @@
|
|
|
1
1
|
# JSON Model Compiler Versions
|
|
2
2
|
|
|
3
|
+
## 2.0.65 on 2026-11-01
|
|
4
|
+
|
|
5
|
+
- models: json schema drafts as a diff (4, 6, 7, 8, 9)
|
|
6
|
+
- tests: also check json schema diff versions
|
|
7
|
+
- tests: add more trafo tests
|
|
8
|
+
- tests: update trafo support in model schema used by some tests
|
|
9
|
+
- models: add for openapi overlay spec
|
|
10
|
+
- models: add json patch spec (RFC6902) and tests
|
|
11
|
+
- model: allow comments in trafo
|
|
12
|
+
- model: fix missing resolver forwarding
|
|
13
|
+
- pr: rewrite trafo spec
|
|
14
|
+
- tests: add sanity assertion about xdist parallel pytest runs
|
|
15
|
+
|
|
16
|
+
## 2.0.64 on 2026-10-26
|
|
17
|
+
|
|
18
|
+
- bench: do not link same version and message artifacts, keep first encountered
|
|
19
|
+
- bench: move corvus at then end of the radar to keep colors consistent
|
|
20
|
+
- bench: run cron bench with corvus
|
|
21
|
+
- bench: re-build corvus image automatically
|
|
22
|
+
- model: transformation rename properties with `~` (experimental)
|
|
23
|
+
- model: transformation make work on import? checked!
|
|
24
|
+
- model: allow to edit definitions (namespace `$foo#`) with transformations
|
|
25
|
+
- models: add `:` trafo to json model meta model
|
|
26
|
+
- models: add diff model from v1 to v2
|
|
27
|
+
- bench: work around cal dns issues
|
|
28
|
+
- bench: fix missing jmc on cron job
|
|
29
|
+
- bench: improve report section title about classification metrics
|
|
30
|
+
- docker: enable user remap (for a long time?)
|
|
31
|
+
- models: add OpenAPI-with-models alternative model
|
|
32
|
+
- model: fix definition cross renames
|
|
33
|
+
- model: add local transformations
|
|
34
|
+
- model: add keep-only transformation
|
|
35
|
+
- model: allow bulk mandatory to optional and optional to mandatory renames
|
|
36
|
+
- model: fix model internals when adding definitions with a namespace trafo
|
|
37
|
+
- models: add json schema draft 03 diff model
|
|
38
|
+
- model: move local transformations _after_ global transformations
|
|
39
|
+
|
|
3
40
|
## 2.0.63 on 2026-10-05
|
|
4
41
|
|
|
5
42
|
- pr: center logo in sidebar
|
|
@@ -158,7 +158,7 @@ on a set of test vectors.
|
|
|
158
158
|
- Number of test vector JSON values: _${n_values}_
|
|
159
159
|
- All tested JSON values (including models, generated schemas and IR, and test suite schemas): _${all_values}_
|
|
160
160
|
|
|
161
|
-
Over
|
|
161
|
+
Over _180,000_ assertion checks are performed when running non-regression tests:
|
|
162
162
|
generated files, values validated in various languages…
|
|
163
163
|
|
|
164
164
|
[Example models](https://json-model.org/MODELS) cover typical use cases and demonstrate
|
|
@@ -20,29 +20,38 @@ get_version()
|
|
|
20
20
|
sed -ne '1,/BENCHES/p' < BENCH.md | grep -v '^BENCHES$'
|
|
21
21
|
|
|
22
22
|
# list max 10 latest artifacts
|
|
23
|
-
nartifacts=0
|
|
23
|
+
nartifacts=0 p_jsu= p_jmc= p_sbc= p_crv= p_msg=
|
|
24
24
|
|
|
25
25
|
for artifact in $(ls site/benchmarks/*.md | sort -r) ; do
|
|
26
|
-
let nartifacts+=1
|
|
27
26
|
|
|
28
|
-
link=${artifact#site/}
|
|
29
|
-
name=${link#benchmarks/}
|
|
30
|
-
name=${name%.md}
|
|
31
27
|
jsu=$(get_version jsu $artifact)
|
|
32
28
|
jmc=$(get_version jmc $artifact)
|
|
33
29
|
sbc=$(get_version jsonschema-cli $artifact)
|
|
34
30
|
crv=$(get_version corvus-cli $artifact)
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
[ "$(grep '
|
|
38
|
-
[ "$(grep '
|
|
31
|
+
|
|
32
|
+
msg=""
|
|
33
|
+
[ "$(grep 'content:.*yes' $artifact)" ] && msg+="content" || msg+="no content"
|
|
34
|
+
[ "$(grep 'JSU_OPT.*--no-id' $artifact)" ] && msg+=", no id" || msg+=", id"
|
|
35
|
+
[ "$(grep 'fix:.*yes' $artifact)" ] && msg+=", fix" || msg+=", no fix"
|
|
36
|
+
|
|
37
|
+
# skip same version (details may differ, keep first encountered)
|
|
38
|
+
[ "$jsu" = "$p_jsu" -a "$jmc" = "$p_jmc" -a \
|
|
39
|
+
"$sbc" = "$p_sbc" -a "$crv" = "$p_crv" -a "$msg" = "$p_msg" ] && continue
|
|
40
|
+
|
|
41
|
+
p_jsu=$jsu p_jmc=$jmc p_sbc=$sbc p_crv=$crv p_msg=$msg
|
|
42
|
+
|
|
43
|
+
link=${artifact#site/}
|
|
44
|
+
name=${link#benchmarks/}
|
|
45
|
+
name=${name%.md}
|
|
46
|
+
|
|
39
47
|
echo "- Artifact [$name]($link) using"
|
|
40
48
|
echo " [JMC $jmc]($PYPI/json-model-compiler/$jmc/), "
|
|
41
49
|
echo " [JSU $jsu]($PYPI/json-schema-utils/$jsu/), "
|
|
42
50
|
[ "$sbc" ] && echo " [SBC $sbc](https://github.com/sourcemeta/jsonschema/releases/tag/v$sbc),"
|
|
43
51
|
[ "$crv" ] && echo " [Corvus $crv](https://corvus-oss.org/Corvus.JsonSchema/),"
|
|
44
|
-
echo " $
|
|
52
|
+
echo " $msg."
|
|
45
53
|
|
|
54
|
+
let nartifacts+=1
|
|
46
55
|
[ $nartifacts -eq $MAX ] && break
|
|
47
56
|
done
|
|
48
57
|
|
|
@@ -60,7 +60,7 @@ def check(jm: JsonModel, assertion: ModelFilter, what: str = "?", short: bool =
|
|
|
60
60
|
okay = False
|
|
61
61
|
return okay if short else True
|
|
62
62
|
|
|
63
|
-
recModel(jm._model, checkFlt, noRwt, True)
|
|
63
|
+
recModel(jm._model, checkFlt, noRwt, True, jm._is_root)
|
|
64
64
|
|
|
65
65
|
return okay
|
|
66
66
|
|
|
@@ -83,6 +83,9 @@ def valid(jm: JsonModel,
|
|
|
83
83
|
ARR_KW = {"!"}
|
|
84
84
|
OP_KW = {"@", "|", "&", "^", "+"}
|
|
85
85
|
|
|
86
|
+
# trafo are applied before checking model validity, thus out of scope
|
|
87
|
+
# TRAFO_KW = {"/", "*", "~"}
|
|
88
|
+
|
|
86
89
|
if extend: # multiple-of: number, contains: model
|
|
87
90
|
CMP_KW |= {".mo"}
|
|
88
91
|
ARR_KW |= {".in"}
|
|
@@ -103,6 +106,10 @@ def valid(jm: JsonModel,
|
|
|
103
106
|
finite = not jm._isRef(ref) or ref == "$#" # Hmmm…
|
|
104
107
|
if not finite:
|
|
105
108
|
log.debug(f"infinite recursion on {smodel}: {recref} ({recid})")
|
|
109
|
+
if jm._debug >= 3:
|
|
110
|
+
log.debug(f"{jm._id}: {jm._model}")
|
|
111
|
+
for name, j in jm._defs.items():
|
|
112
|
+
log.debug(f"{jm._id}: {name} -> {j._id} ({j._model})")
|
|
106
113
|
return finite
|
|
107
114
|
|
|
108
115
|
def validFlt(model: ModelType, path: ModelPath) -> bool:
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
2.0.65
|