Repository navigation
Allow JSON null in JSON-able values - #873
Merged
Merged
Conversation
mristin
force-pushed
the
mristin/Allow-JSON-null-in-JSON-able-values
branch
2 times, most recently
from
October 30, 2026 16:27
45f63fb to
e76e7cc
Compare
Coverage Report for CI Build 41188388014Coverage increased (+0.02%) to 90.251%Details
Uncovered ChangesNo uncovered changes found. Coverage Regressions888 previously-covered lines in 27 files lost coverage.
Coverage Stats
💛 - Coveralls |
mristin
force-pushed
the
mristin/Allow-JSON-null-in-JSON-able-values
branch
from
October 30, 2026 17:01
e76e7cc to
a2583e6
Compare
In value-only JSON, an empty element of a SubmodelElementList is
serialized as ``null`` to preserve the list indices (e.g.,
``[10, null]``), but we rejected null in ``JSONValue``. We now include
``None`` in ``JSONValue``, so a null may appear at any depth, including
as the value itself.
An optional ``JSONValue`` holding a null counts as absent, and we omit
the key on serialization in all the targets.
In the meta-model, ``is None`` and ``is not None`` over a non-optional
``JSONValue`` (a guarded index or a required property) now check for
a JSON null:
m is not None and "k" in m and m["k"] is not None
An unguarded key index still can not be checked for nullness since it
would conflate a missing key with a null.
JSON schema includes ``{"type": "null"}``, and XML-RPC uses
the widespread ``<nil/>`` extension, reflected in the XSD.
In TypeScript, we now tell success from failure in ``Either`` by
the error alone, so that ``null`` can be a successfully parsed value.
mristin
force-pushed
the
mristin/Allow-JSON-null-in-JSON-able-values
branch
from
October 31, 2026 09:21
a2583e6 to
e99db58
Compare
mristin
added a commit
to eclipse-aascw/aas-core3.2-python
that referenced
this pull request
Oct 31, 2026
We update to aas-core-codegen 0.0.27rc5 and to the latest aas-core-meta 796ae74, and re-generate the code. The meta-model file itself is pinned to 543f3c0, the last commit which changed ``v3_2.py``. The relevant changes are: * JSON-able values admit JSON null (``None``) at any depth ([aas-core-codegen#873], [aas-core-meta#416]), *e.g.*, for an empty element of a submodel element list in the ValueOnly JSON. An optional JSON-able property holding a null counts as absent. In XML-RPC, a null is written as ``<nil/>``. * The results of ``GetSubmodelsValueResult`` and ``GetSubmodelElementsValueResult`` are arrays of ValueOnly JSON objects instead of a single JSON object ([aas-core-meta#415]). We deviate from the OpenAPI since V3.0.4 ([aas-specs-api#414]), which we suspect to be buggy, and follow [BaSyx Go] and the prose of the specification. [aas-core-codegen#873]: eclipse-aascw/aas-core-codegen#873 [aas-core-meta#416]: eclipse-aascw/aas-core-meta#416 [aas-core-meta#415]: eclipse-aascw/aas-core-meta#415 [aas-specs-api#414]: admin-shell-io/aas-specs-api#414 [BaSyx Go]: https://github.com/eclipse-basyx/basyx-go-components
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
In value-only JSON, an empty element of a SubmodelElementList is serialized as
nullto preserve the list indices (e.g.,[10, null]), but we rejected null inJSONValue. We now includeNoneinJSONValue, so a null may appear at any depth, including as the value itself.An optional
JSONValueholding a null counts as absent, and we omit the key on serialization in all the targets.In the meta-model,
is Noneandis not Noneover a non-optionalJSONValue(a guarded index or a required property) now check for a JSON null:An unguarded key index still can not be checked for nullness since it would conflate a missing key with a null.
JSON schema includes
{"type": "null"}, and XML-RPC uses the widespread<nil/>extension, reflected in the XSD.In TypeScript, we now tell success from failure in
Eitherby the error alone, so thatnullcan be a successfully parsed value.