Repository navigation
adapter.json: Omit specificAssetIds on an Entity without any - #638
Merged
zrgt merged 1 commit intoOct 6, 2026
Merged
Conversation
leogrox
force-pushed
the
fix/entity-empty-specific-asset-ids
branch
from
September 20, 2026 10:34
59c698b to
edcc3c0
Compare
zrgt
requested changes
Sep 25, 2026
Comment on lines
+711
to
+712
| # specific_asset_id is a collection, so it is never None. An empty one has to be | ||
| # left out: the schema gives specificAssetIds minItems 1, as it does every array. |
Contributor
There was a problem hiding this comment.
remove the comments. Commit message would be enough.
Member
|
I bumped the milestone for this to version 2.3.0, as we release 2.2.0 today and this is not ready yet. |
leogrox
force-pushed
the
fix/entity-empty-specific-asset-ids
branch
3 times, most recently
from
October 5, 2026 14:06
ad925bb to
188047b
Compare
`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>
leogrox
force-pushed
the
fix/entity-empty-specific-asset-ids
branch
from
October 5, 2026 14:09
188047b to
1dc8a24
Compare
Author
|
Done: the comment is gone and the reasoning is in the commit message. I kept the short comments in the two tests, since they say which AASd-014 case each one covers; happy to drop those too if you'd rather. |
zrgt
approved these changes
Oct 6, 2026
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.