Conversation
`specific_asset_id` is a collection, so it is never `None` and the guard let an empty one through as `"specificAssetIds": []`. Every array in the AAS JSON schema carries `minItems: 1`, so that array is invalid, and AASd-014 forbids specific asset ids on a co-managed entity, which makes every serialized co-managed `Entity` invalid, the example AAS included. Guard on the collection being non-empty, as the neighbouring attributes and `AssetInformation` already do. Signed-off-by: LGUIUX <phdl@outlook.es>
LGUIUX
force-pushed
the
fix/entity-empty-specific-asset-ids
branch
from
September 20, 2026 10:34
59c698b to
edcc3c0
Compare
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.
Fixes #636.
Entity.specific_asset_idis a collection, so it is neverNoneand theis not Noneguard let an empty one through as"specificAssetIds": []. Every array in the AAS JSON schema carriesminItems: 1, and AASd-014 forbids specific asset ids on a co-managed entity, so every serialized co-managedEntitywas invalid, the example AAS included.The guard now tests the collection for content, as the neighbouring attributes and
AssetInformation(L320) already do.Testing
Two tests in
test/adapter/json/test_json_serialization.py: the key is left out when the collection is empty, and still written when it isn't. Both are schema-independent, so they run whether or not the schema files are present.python -m unittestinsdk/: 282 tests, OK.mypyandpycodestyleclean. Without the change, three fail: the new assertion plusJsonSerializationSchemaTest.test_full_example_serializationandtest_aas_example_serialization, which catch it as soon as the schema file is actually there, which in CI it isn't; see #637.