Skip to content

Commit

Permalink
Fix jsonization confusing dict for array
Browse files Browse the repository at this point in the history
We fix the JSON de-serialization so that it explicitly check that a
property is an array-like value instead of simply checking for
inheritance from ``collections.abc.Iterable``, as mappings are also
iterables in Python.

This corresponds to [aas-core-codegen bcab1a9c].

[aas-core-codegen bcab1a9c]: aas-core-works/aas-core-codegen@bcab1a9c

Fixes #31.
  • Loading branch information
mristin committed Jul 6, 2024
1 parent 1ee54d6 commit 2b1a543
Show file tree
Hide file tree
Showing 127 changed files with 829 additions and 621 deletions.
1,166 changes: 670 additions & 496 deletions aas_core3/jsonization.py

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -1 +1 @@
assetAdministrationShells[0].embeddedDataSpecifications[0].dataSpecificationContent.preferredName: Expected an iterable, but got: <class 'NoneType'>
assetAdministrationShells[0].embeddedDataSpecifications[0].dataSpecificationContent.preferredName: Expected something array-like, but got: <class 'NoneType'>
Original file line number Diff line number Diff line change
@@ -1 +1 @@
assetAdministrationShells[0].derivedFrom.keys: Expected an iterable, but got: <class 'NoneType'>
assetAdministrationShells[0].derivedFrom.keys: Expected something array-like, but got: <class 'NoneType'>
Original file line number Diff line number Diff line change
@@ -1 +1 @@
assetAdministrationShells[0].embeddedDataSpecifications[0].dataSpecificationContent.valueList.valueReferencePairs: Expected an iterable, but got: <class 'NoneType'>
assetAdministrationShells[0].embeddedDataSpecifications[0].dataSpecificationContent.valueList.valueReferencePairs: Expected something array-like, but got: <class 'NoneType'>
Original file line number Diff line number Diff line change
@@ -1 +1 @@
assetAdministrationShells[0].administration.embeddedDataSpecifications[0]: Expected a mapping, but got: <class 'str'>
assetAdministrationShells[0].administration.embeddedDataSpecifications: Expected something array-like, but got: <class 'str'>
Original file line number Diff line number Diff line change
@@ -1 +1 @@
submodels[0].submodelElements[0].annotations[0]: Expected a mapping, but got: <class 'str'>
submodels[0].submodelElements[0].annotations: Expected something array-like, but got: <class 'str'>
Original file line number Diff line number Diff line change
@@ -1 +1 @@
submodels[0].submodelElements[0].description[0]: Expected a mapping, but got: <class 'str'>
submodels[0].submodelElements[0].description: Expected something array-like, but got: <class 'str'>
Original file line number Diff line number Diff line change
@@ -1 +1 @@
submodels[0].submodelElements[0].displayName[0]: Expected a mapping, but got: <class 'str'>
submodels[0].submodelElements[0].displayName: Expected something array-like, but got: <class 'str'>
Original file line number Diff line number Diff line change
@@ -1 +1 @@
submodels[0].submodelElements[0].embeddedDataSpecifications[0]: Expected a mapping, but got: <class 'str'>
submodels[0].submodelElements[0].embeddedDataSpecifications: Expected something array-like, but got: <class 'str'>
Original file line number Diff line number Diff line change
@@ -1 +1 @@
submodels[0].submodelElements[0].extensions[0]: Expected a mapping, but got: <class 'str'>
submodels[0].submodelElements[0].extensions: Expected something array-like, but got: <class 'str'>
Original file line number Diff line number Diff line change
@@ -1 +1 @@
submodels[0].submodelElements[0].qualifiers[0]: Expected a mapping, but got: <class 'str'>
submodels[0].submodelElements[0].qualifiers: Expected something array-like, but got: <class 'str'>
Original file line number Diff line number Diff line change
@@ -1 +1 @@
submodels[0].submodelElements[0].supplementalSemanticIds[0]: Expected a mapping, but got: <class 'str'>
submodels[0].submodelElements[0].supplementalSemanticIds: Expected something array-like, but got: <class 'str'>
Original file line number Diff line number Diff line change
@@ -1 +1 @@
assetAdministrationShells[0].description[0]: Expected a mapping, but got: <class 'str'>
assetAdministrationShells[0].description: Expected something array-like, but got: <class 'str'>
Original file line number Diff line number Diff line change
@@ -1 +1 @@
assetAdministrationShells[0].displayName[0]: Expected a mapping, but got: <class 'str'>
assetAdministrationShells[0].displayName: Expected something array-like, but got: <class 'str'>
Original file line number Diff line number Diff line change
@@ -1 +1 @@
assetAdministrationShells[0].embeddedDataSpecifications[0]: Expected a mapping, but got: <class 'str'>
assetAdministrationShells[0].embeddedDataSpecifications: Expected something array-like, but got: <class 'str'>
Original file line number Diff line number Diff line change
@@ -1 +1 @@
assetAdministrationShells[0].extensions[0]: Expected a mapping, but got: <class 'str'>
assetAdministrationShells[0].extensions: Expected something array-like, but got: <class 'str'>
Original file line number Diff line number Diff line change
@@ -1 +1 @@
assetAdministrationShells[0].submodels[0]: Expected a mapping, but got: <class 'str'>
assetAdministrationShells[0].submodels: Expected something array-like, but got: <class 'str'>
Original file line number Diff line number Diff line change
@@ -1 +1 @@
submodels[0].submodelElements[0].description[0]: Expected a mapping, but got: <class 'str'>
submodels[0].submodelElements[0].description: Expected something array-like, but got: <class 'str'>
Original file line number Diff line number Diff line change
@@ -1 +1 @@
submodels[0].submodelElements[0].displayName[0]: Expected a mapping, but got: <class 'str'>
submodels[0].submodelElements[0].displayName: Expected something array-like, but got: <class 'str'>
Original file line number Diff line number Diff line change
@@ -1 +1 @@
submodels[0].submodelElements[0].embeddedDataSpecifications[0]: Expected a mapping, but got: <class 'str'>
submodels[0].submodelElements[0].embeddedDataSpecifications: Expected something array-like, but got: <class 'str'>
Original file line number Diff line number Diff line change
@@ -1 +1 @@
submodels[0].submodelElements[0].extensions[0]: Expected a mapping, but got: <class 'str'>
submodels[0].submodelElements[0].extensions: Expected something array-like, but got: <class 'str'>
Original file line number Diff line number Diff line change
@@ -1 +1 @@
submodels[0].submodelElements[0].qualifiers[0]: Expected a mapping, but got: <class 'str'>
submodels[0].submodelElements[0].qualifiers: Expected something array-like, but got: <class 'str'>
Original file line number Diff line number Diff line change
@@ -1 +1 @@
submodels[0].submodelElements[0].supplementalSemanticIds[0]: Expected a mapping, but got: <class 'str'>
submodels[0].submodelElements[0].supplementalSemanticIds: Expected something array-like, but got: <class 'str'>
Original file line number Diff line number Diff line change
@@ -1 +1 @@
submodels[0].submodelElements[0].description[0]: Expected a mapping, but got: <class 'str'>
submodels[0].submodelElements[0].description: Expected something array-like, but got: <class 'str'>
Original file line number Diff line number Diff line change
@@ -1 +1 @@
submodels[0].submodelElements[0].displayName[0]: Expected a mapping, but got: <class 'str'>
submodels[0].submodelElements[0].displayName: Expected something array-like, but got: <class 'str'>
Original file line number Diff line number Diff line change
@@ -1 +1 @@
submodels[0].submodelElements[0].embeddedDataSpecifications[0]: Expected a mapping, but got: <class 'str'>
submodels[0].submodelElements[0].embeddedDataSpecifications: Expected something array-like, but got: <class 'str'>
Original file line number Diff line number Diff line change
@@ -1 +1 @@
submodels[0].submodelElements[0].extensions[0]: Expected a mapping, but got: <class 'str'>
submodels[0].submodelElements[0].extensions: Expected something array-like, but got: <class 'str'>
Original file line number Diff line number Diff line change
@@ -1 +1 @@
submodels[0].submodelElements[0].qualifiers[0]: Expected a mapping, but got: <class 'str'>
submodels[0].submodelElements[0].qualifiers: Expected something array-like, but got: <class 'str'>
Original file line number Diff line number Diff line change
@@ -1 +1 @@
submodels[0].submodelElements[0].supplementalSemanticIds[0]: Expected a mapping, but got: <class 'str'>
submodels[0].submodelElements[0].supplementalSemanticIds: Expected something array-like, but got: <class 'str'>
Original file line number Diff line number Diff line change
@@ -1 +1 @@
submodels[0].submodelElements[0].description[0]: Expected a mapping, but got: <class 'str'>
submodels[0].submodelElements[0].description: Expected something array-like, but got: <class 'str'>
Original file line number Diff line number Diff line change
@@ -1 +1 @@
submodels[0].submodelElements[0].displayName[0]: Expected a mapping, but got: <class 'str'>
submodels[0].submodelElements[0].displayName: Expected something array-like, but got: <class 'str'>
Original file line number Diff line number Diff line change
@@ -1 +1 @@
submodels[0].submodelElements[0].embeddedDataSpecifications[0]: Expected a mapping, but got: <class 'str'>
submodels[0].submodelElements[0].embeddedDataSpecifications: Expected something array-like, but got: <class 'str'>
Original file line number Diff line number Diff line change
@@ -1 +1 @@
submodels[0].submodelElements[0].extensions[0]: Expected a mapping, but got: <class 'str'>
submodels[0].submodelElements[0].extensions: Expected something array-like, but got: <class 'str'>
Original file line number Diff line number Diff line change
@@ -1 +1 @@
submodels[0].submodelElements[0].qualifiers[0]: Expected a mapping, but got: <class 'str'>
submodels[0].submodelElements[0].qualifiers: Expected something array-like, but got: <class 'str'>
Original file line number Diff line number Diff line change
@@ -1 +1 @@
submodels[0].submodelElements[0].supplementalSemanticIds[0]: Expected a mapping, but got: <class 'str'>
submodels[0].submodelElements[0].supplementalSemanticIds: Expected something array-like, but got: <class 'str'>
Original file line number Diff line number Diff line change
@@ -1 +1 @@
conceptDescriptions[0].description[0]: Expected a mapping, but got: <class 'str'>
conceptDescriptions[0].description: Expected something array-like, but got: <class 'str'>
Original file line number Diff line number Diff line change
@@ -1 +1 @@
conceptDescriptions[0].displayName[0]: Expected a mapping, but got: <class 'str'>
conceptDescriptions[0].displayName: Expected something array-like, but got: <class 'str'>
Original file line number Diff line number Diff line change
@@ -1 +1 @@
conceptDescriptions[0].embeddedDataSpecifications[0]: Expected a mapping, but got: <class 'str'>
conceptDescriptions[0].embeddedDataSpecifications: Expected something array-like, but got: <class 'str'>
Original file line number Diff line number Diff line change
@@ -1 +1 @@
conceptDescriptions[0].extensions[0]: Expected a mapping, but got: <class 'str'>
conceptDescriptions[0].extensions: Expected something array-like, but got: <class 'str'>
Original file line number Diff line number Diff line change
@@ -1 +1 @@
conceptDescriptions[0].isCaseOf[0]: Expected a mapping, but got: <class 'str'>
conceptDescriptions[0].isCaseOf: Expected something array-like, but got: <class 'str'>
Original file line number Diff line number Diff line change
@@ -1 +1 @@
assetAdministrationShells[0].embeddedDataSpecifications[0].dataSpecificationContent.definition[0]: Expected a mapping, but got: <class 'str'>
assetAdministrationShells[0].embeddedDataSpecifications[0].dataSpecificationContent.definition: Expected something array-like, but got: <class 'str'>
Original file line number Diff line number Diff line change
@@ -1 +1 @@
assetAdministrationShells[0].embeddedDataSpecifications[0].dataSpecificationContent.preferredName[0]: Expected a mapping, but got: <class 'str'>
assetAdministrationShells[0].embeddedDataSpecifications[0].dataSpecificationContent.preferredName: Expected something array-like, but got: <class 'str'>
Original file line number Diff line number Diff line change
@@ -1 +1 @@
assetAdministrationShells[0].embeddedDataSpecifications[0].dataSpecificationContent.shortName[0]: Expected a mapping, but got: <class 'str'>
assetAdministrationShells[0].embeddedDataSpecifications[0].dataSpecificationContent.shortName: Expected something array-like, but got: <class 'str'>
Original file line number Diff line number Diff line change
@@ -1 +1 @@
submodels[0].submodelElements[0].description[0]: Expected a mapping, but got: <class 'str'>
submodels[0].submodelElements[0].description: Expected something array-like, but got: <class 'str'>
Original file line number Diff line number Diff line change
@@ -1 +1 @@
submodels[0].submodelElements[0].displayName[0]: Expected a mapping, but got: <class 'str'>
submodels[0].submodelElements[0].displayName: Expected something array-like, but got: <class 'str'>
Original file line number Diff line number Diff line change
@@ -1 +1 @@
submodels[0].submodelElements[0].embeddedDataSpecifications[0]: Expected a mapping, but got: <class 'str'>
submodels[0].submodelElements[0].embeddedDataSpecifications: Expected something array-like, but got: <class 'str'>
Original file line number Diff line number Diff line change
@@ -1 +1 @@
submodels[0].submodelElements[0].extensions[0]: Expected a mapping, but got: <class 'str'>
submodels[0].submodelElements[0].extensions: Expected something array-like, but got: <class 'str'>
Original file line number Diff line number Diff line change
@@ -1 +1 @@
submodels[0].submodelElements[0].qualifiers[0]: Expected a mapping, but got: <class 'str'>
submodels[0].submodelElements[0].qualifiers: Expected something array-like, but got: <class 'str'>
Original file line number Diff line number Diff line change
@@ -1 +1 @@
submodels[0].submodelElements[0].statements[0]: Expected a mapping, but got: <class 'str'>
submodels[0].submodelElements[0].statements: Expected something array-like, but got: <class 'str'>
Original file line number Diff line number Diff line change
@@ -1 +1 @@
submodels[0].submodelElements[0].supplementalSemanticIds[0]: Expected a mapping, but got: <class 'str'>
submodels[0].submodelElements[0].supplementalSemanticIds: Expected something array-like, but got: <class 'str'>
Original file line number Diff line number Diff line change
@@ -1 +1 @@
assetAdministrationShells[0].extensions[0].refersTo[0]: Expected a mapping, but got: <class 'str'>
assetAdministrationShells[0].extensions[0].refersTo: Expected something array-like, but got: <class 'str'>
Original file line number Diff line number Diff line change
@@ -1 +1 @@
assetAdministrationShells[0].extensions[0].supplementalSemanticIds[0]: Expected a mapping, but got: <class 'str'>
assetAdministrationShells[0].extensions[0].supplementalSemanticIds: Expected something array-like, but got: <class 'str'>
Original file line number Diff line number Diff line change
@@ -1 +1 @@
submodels[0].submodelElements[0].description[0]: Expected a mapping, but got: <class 'str'>
submodels[0].submodelElements[0].description: Expected something array-like, but got: <class 'str'>
Original file line number Diff line number Diff line change
@@ -1 +1 @@
submodels[0].submodelElements[0].displayName[0]: Expected a mapping, but got: <class 'str'>
submodels[0].submodelElements[0].displayName: Expected something array-like, but got: <class 'str'>
Original file line number Diff line number Diff line change
@@ -1 +1 @@
submodels[0].submodelElements[0].embeddedDataSpecifications[0]: Expected a mapping, but got: <class 'str'>
submodels[0].submodelElements[0].embeddedDataSpecifications: Expected something array-like, but got: <class 'str'>
Original file line number Diff line number Diff line change
@@ -1 +1 @@
submodels[0].submodelElements[0].extensions[0]: Expected a mapping, but got: <class 'str'>
submodels[0].submodelElements[0].extensions: Expected something array-like, but got: <class 'str'>
Original file line number Diff line number Diff line change
@@ -1 +1 @@
submodels[0].submodelElements[0].qualifiers[0]: Expected a mapping, but got: <class 'str'>
submodels[0].submodelElements[0].qualifiers: Expected something array-like, but got: <class 'str'>
Original file line number Diff line number Diff line change
@@ -1 +1 @@
submodels[0].submodelElements[0].supplementalSemanticIds[0]: Expected a mapping, but got: <class 'str'>
submodels[0].submodelElements[0].supplementalSemanticIds: Expected something array-like, but got: <class 'str'>
Original file line number Diff line number Diff line change
@@ -1 +1 @@
submodels[0].submodelElements[0].description[0]: Expected a mapping, but got: <class 'str'>
submodels[0].submodelElements[0].description: Expected something array-like, but got: <class 'str'>
Original file line number Diff line number Diff line change
@@ -1 +1 @@
submodels[0].submodelElements[0].displayName[0]: Expected a mapping, but got: <class 'str'>
submodels[0].submodelElements[0].displayName: Expected something array-like, but got: <class 'str'>
Original file line number Diff line number Diff line change
@@ -1 +1 @@
submodels[0].submodelElements[0].embeddedDataSpecifications[0]: Expected a mapping, but got: <class 'str'>
submodels[0].submodelElements[0].embeddedDataSpecifications: Expected something array-like, but got: <class 'str'>
Original file line number Diff line number Diff line change
@@ -1 +1 @@
submodels[0].submodelElements[0].extensions[0]: Expected a mapping, but got: <class 'str'>
submodels[0].submodelElements[0].extensions: Expected something array-like, but got: <class 'str'>
Original file line number Diff line number Diff line change
@@ -1 +1 @@
submodels[0].submodelElements[0].qualifiers[0]: Expected a mapping, but got: <class 'str'>
submodels[0].submodelElements[0].qualifiers: Expected something array-like, but got: <class 'str'>
Original file line number Diff line number Diff line change
@@ -1 +1 @@
submodels[0].submodelElements[0].supplementalSemanticIds[0]: Expected a mapping, but got: <class 'str'>
submodels[0].submodelElements[0].supplementalSemanticIds: Expected something array-like, but got: <class 'str'>
Original file line number Diff line number Diff line change
@@ -1 +1 @@
submodels[0].submodelElements[0].value[0]: Expected a mapping, but got: <class 'str'>
submodels[0].submodelElements[0].value: Expected something array-like, but got: <class 'str'>
Original file line number Diff line number Diff line change
@@ -1 +1 @@
submodels[0].submodelElements[0].description[0]: Expected a mapping, but got: <class 'str'>
submodels[0].submodelElements[0].description: Expected something array-like, but got: <class 'str'>
Original file line number Diff line number Diff line change
@@ -1 +1 @@
submodels[0].submodelElements[0].displayName[0]: Expected a mapping, but got: <class 'str'>
submodels[0].submodelElements[0].displayName: Expected something array-like, but got: <class 'str'>
Original file line number Diff line number Diff line change
@@ -1 +1 @@
submodels[0].submodelElements[0].embeddedDataSpecifications[0]: Expected a mapping, but got: <class 'str'>
submodels[0].submodelElements[0].embeddedDataSpecifications: Expected something array-like, but got: <class 'str'>
Original file line number Diff line number Diff line change
@@ -1 +1 @@
submodels[0].submodelElements[0].extensions[0]: Expected a mapping, but got: <class 'str'>
submodels[0].submodelElements[0].extensions: Expected something array-like, but got: <class 'str'>
Original file line number Diff line number Diff line change
@@ -1 +1 @@
submodels[0].submodelElements[0].inoutputVariables[0]: Expected a mapping, but got: <class 'str'>
submodels[0].submodelElements[0].inoutputVariables: Expected something array-like, but got: <class 'str'>
Original file line number Diff line number Diff line change
@@ -1 +1 @@
submodels[0].submodelElements[0].inputVariables[0]: Expected a mapping, but got: <class 'str'>
submodels[0].submodelElements[0].inputVariables: Expected something array-like, but got: <class 'str'>
Original file line number Diff line number Diff line change
@@ -1 +1 @@
submodels[0].submodelElements[0].outputVariables[0]: Expected a mapping, but got: <class 'str'>
submodels[0].submodelElements[0].outputVariables: Expected something array-like, but got: <class 'str'>
Original file line number Diff line number Diff line change
@@ -1 +1 @@
submodels[0].submodelElements[0].qualifiers[0]: Expected a mapping, but got: <class 'str'>
submodels[0].submodelElements[0].qualifiers: Expected something array-like, but got: <class 'str'>
Original file line number Diff line number Diff line change
@@ -1 +1 @@
submodels[0].submodelElements[0].supplementalSemanticIds[0]: Expected a mapping, but got: <class 'str'>
submodels[0].submodelElements[0].supplementalSemanticIds: Expected something array-like, but got: <class 'str'>
Original file line number Diff line number Diff line change
@@ -1 +1 @@
submodels[0].submodelElements[0].description[0]: Expected a mapping, but got: <class 'str'>
submodels[0].submodelElements[0].description: Expected something array-like, but got: <class 'str'>
Loading

0 comments on commit 2b1a543

Please sign in to comment.