-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Check explicitly for invalid model types (#37)
We explicitly check during the JSON de-serialization that model types correspond to the expected model types. We need to be particularly careful with concrete classes without descendants with a mandatory ``modelType``, as they do not necessarily require a model type for de-serialization, but the specs mandate it for reasons of backward compatibility. The code corresponds to [aas-core-codegen b537610b], and the test data corresponds to [aas-core3.0-testgen 9e523511c]. This is related to the issue [aas-core3.0-python #32], which discovered the problematic in the first place. [aas-core-codegen b537610b]: aas-core-works/aas-core-codegen@b537610b [aas-core3.0-testgen 9e523511c]: aas-core-works/aas-core3.0-testgen@9e523511c [aas-core3.0-python #32]: aas-core-works/aas-core3.0-python#32
- Loading branch information
Showing
38 changed files
with
1,017 additions
and
25 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains 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
31 changes: 31 additions & 0 deletions
31
...pected/Unserializable/MissingModelType/AnnotatedRelationshipElement/withoutModelType.json
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
{ | ||
"submodels": [ | ||
{ | ||
"id": "something_48c66017", | ||
"modelType": "Submodel", | ||
"submodelElements": [ | ||
{ | ||
"first": { | ||
"keys": [ | ||
{ | ||
"type": "GlobalReference", | ||
"value": "urn:another-company01:f390f801" | ||
} | ||
], | ||
"type": "ExternalReference" | ||
}, | ||
"idShort": "something3fdd3eb4", | ||
"second": { | ||
"keys": [ | ||
{ | ||
"type": "GlobalReference", | ||
"value": "urn:an-example05:b7bf2725" | ||
} | ||
], | ||
"type": "ExternalReference" | ||
} | ||
} | ||
] | ||
} | ||
] | ||
} |
1 change: 1 addition & 0 deletions
1
...erializable/MissingModelType/AnnotatedRelationshipElement/withoutModelType.json.exception
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Expected a model type, but none is present at: submodels[0].submodelElements[0] |
11 changes: 11 additions & 0 deletions
11
...Unexpected/Unserializable/MissingModelType/AssetAdministrationShell/withoutModelType.json
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{ | ||
"assetAdministrationShells": [ | ||
{ | ||
"assetInformation": { | ||
"assetKind": "NotApplicable", | ||
"globalAssetId": "something_eea66fa1" | ||
}, | ||
"id": "something_142922d6" | ||
} | ||
] | ||
} |
1 change: 1 addition & 0 deletions
1
.../Unserializable/MissingModelType/AssetAdministrationShell/withoutModelType.json.exception
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Required property "modelType" is missing at: assetAdministrationShells[0] |
24 changes: 24 additions & 0 deletions
24
...onment/Unexpected/Unserializable/MissingModelType/BasicEventElement/withoutModelType.json
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
{ | ||
"submodels": [ | ||
{ | ||
"id": "something_48c66017", | ||
"modelType": "Submodel", | ||
"submodelElements": [ | ||
{ | ||
"direction": "output", | ||
"idShort": "something3fdd3eb4", | ||
"observed": { | ||
"keys": [ | ||
{ | ||
"type": "Submodel", | ||
"value": "urn:another-example11:3679ef43" | ||
} | ||
], | ||
"type": "ModelReference" | ||
}, | ||
"state": "off" | ||
} | ||
] | ||
} | ||
] | ||
} |
1 change: 1 addition & 0 deletions
1
...xpected/Unserializable/MissingModelType/BasicEventElement/withoutModelType.json.exception
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Expected a model type, but none is present at: submodels[0].submodelElements[0] |
14 changes: 14 additions & 0 deletions
14
...tainedInEnvironment/Unexpected/Unserializable/MissingModelType/Blob/withoutModelType.json
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
{ | ||
"submodels": [ | ||
{ | ||
"id": "something_48c66017", | ||
"modelType": "Submodel", | ||
"submodelElements": [ | ||
{ | ||
"contentType": "'VbrwFrYTU/fO7NnLxq \t; \tMX.`10dB732`X5yRy=I56Ov9Us\t ;\t\t pRb~~hdw_C%2Zf=\"\"\t\t\t \t\t\t \t \t\t \t ; h=1t", | ||
"idShort": "something3fdd3eb4" | ||
} | ||
] | ||
} | ||
] | ||
} |
1 change: 1 addition & 0 deletions
1
...vironment/Unexpected/Unserializable/MissingModelType/Blob/withoutModelType.json.exception
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Expected a model type, but none is present at: submodels[0].submodelElements[0] |
13 changes: 13 additions & 0 deletions
13
...InEnvironment/Unexpected/Unserializable/MissingModelType/Capability/withoutModelType.json
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
{ | ||
"submodels": [ | ||
{ | ||
"id": "something_48c66017", | ||
"modelType": "Submodel", | ||
"submodelElements": [ | ||
{ | ||
"idShort": "something3fdd3eb4" | ||
} | ||
] | ||
} | ||
] | ||
} |
1 change: 1 addition & 0 deletions
1
...ent/Unexpected/Unserializable/MissingModelType/Capability/withoutModelType.json.exception
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Expected a model type, but none is present at: submodels[0].submodelElements[0] |
7 changes: 7 additions & 0 deletions
7
...nment/Unexpected/Unserializable/MissingModelType/ConceptDescription/withoutModelType.json
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"conceptDescriptions": [ | ||
{ | ||
"id": "something_8ccad77f" | ||
} | ||
] | ||
} |
1 change: 1 addition & 0 deletions
1
...pected/Unserializable/MissingModelType/ConceptDescription/withoutModelType.json.exception
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Required property "modelType" is missing at: conceptDescriptions[0] |
29 changes: 29 additions & 0 deletions
29
...nexpected/Unserializable/MissingModelType/DataSpecificationIec61360/withoutModelType.json
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
{ | ||
"assetAdministrationShells": [ | ||
{ | ||
"assetInformation": { | ||
"assetKind": "NotApplicable", | ||
"globalAssetId": "something_eea66fa1" | ||
}, | ||
"embeddedDataSpecifications": [ | ||
{ | ||
"dataSpecificationContent": { | ||
"preferredName": [ | ||
{ | ||
"language": "i-enochian", | ||
"text": "something_84b0b440" | ||
}, | ||
{ | ||
"language": "en-GB", | ||
"text": "Something random in English 5b15c20d" | ||
} | ||
], | ||
"value": "something_13759f45" | ||
} | ||
} | ||
], | ||
"id": "something_142922d6", | ||
"modelType": "AssetAdministrationShell" | ||
} | ||
] | ||
} |
1 change: 1 addition & 0 deletions
1
...Unserializable/MissingModelType/DataSpecificationIec61360/withoutModelType.json.exception
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Expected a model type, but none is present at: assetAdministrationShells[0].embeddedDataSpecifications[0].dataSpecificationContent |
14 changes: 14 additions & 0 deletions
14
...inedInEnvironment/Unexpected/Unserializable/MissingModelType/Entity/withoutModelType.json
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
{ | ||
"submodels": [ | ||
{ | ||
"id": "something_48c66017", | ||
"modelType": "Submodel", | ||
"submodelElements": [ | ||
{ | ||
"entityType": "CoManagedEntity", | ||
"idShort": "something3fdd3eb4" | ||
} | ||
] | ||
} | ||
] | ||
} |
1 change: 1 addition & 0 deletions
1
...ronment/Unexpected/Unserializable/MissingModelType/Entity/withoutModelType.json.exception
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Expected a model type, but none is present at: submodels[0].submodelElements[0] |
14 changes: 14 additions & 0 deletions
14
...tainedInEnvironment/Unexpected/Unserializable/MissingModelType/File/withoutModelType.json
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
{ | ||
"submodels": [ | ||
{ | ||
"id": "something_48c66017", | ||
"modelType": "Submodel", | ||
"submodelElements": [ | ||
{ | ||
"contentType": "'VbrwFrYTU/fO7NnLxq \t; \tMX.`10dB732`X5yRy=I56Ov9Us\t ;\t\t pRb~~hdw_C%2Zf=\"\"\t\t\t \t\t\t \t \t\t \t ; h=1t", | ||
"idShort": "something3fdd3eb4" | ||
} | ||
] | ||
} | ||
] | ||
} |
1 change: 1 addition & 0 deletions
1
...vironment/Unexpected/Unserializable/MissingModelType/File/withoutModelType.json.exception
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Expected a model type, but none is present at: submodels[0].submodelElements[0] |
13 changes: 13 additions & 0 deletions
13
...nt/Unexpected/Unserializable/MissingModelType/MultiLanguageProperty/withoutModelType.json
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
{ | ||
"submodels": [ | ||
{ | ||
"id": "something_48c66017", | ||
"modelType": "Submodel", | ||
"submodelElements": [ | ||
{ | ||
"idShort": "something3fdd3eb4" | ||
} | ||
] | ||
} | ||
] | ||
} |
1 change: 1 addition & 0 deletions
1
...ted/Unserializable/MissingModelType/MultiLanguageProperty/withoutModelType.json.exception
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Expected a model type, but none is present at: submodels[0].submodelElements[0] |
13 changes: 13 additions & 0 deletions
13
...dInEnvironment/Unexpected/Unserializable/MissingModelType/Operation/withoutModelType.json
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
{ | ||
"submodels": [ | ||
{ | ||
"id": "something_48c66017", | ||
"modelType": "Submodel", | ||
"submodelElements": [ | ||
{ | ||
"idShort": "something3fdd3eb4" | ||
} | ||
] | ||
} | ||
] | ||
} |
1 change: 1 addition & 0 deletions
1
...ment/Unexpected/Unserializable/MissingModelType/Operation/withoutModelType.json.exception
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Expected a model type, but none is present at: submodels[0].submodelElements[0] |
14 changes: 14 additions & 0 deletions
14
...edInEnvironment/Unexpected/Unserializable/MissingModelType/Property/withoutModelType.json
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
{ | ||
"submodels": [ | ||
{ | ||
"id": "something_48c66017", | ||
"modelType": "Submodel", | ||
"submodelElements": [ | ||
{ | ||
"idShort": "something3fdd3eb4", | ||
"valueType": "xs:decimal" | ||
} | ||
] | ||
} | ||
] | ||
} |
1 change: 1 addition & 0 deletions
1
...nment/Unexpected/Unserializable/MissingModelType/Property/withoutModelType.json.exception
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Expected a model type, but none is present at: submodels[0].submodelElements[0] |
14 changes: 14 additions & 0 deletions
14
...ainedInEnvironment/Unexpected/Unserializable/MissingModelType/Range/withoutModelType.json
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
{ | ||
"submodels": [ | ||
{ | ||
"id": "something_48c66017", | ||
"modelType": "Submodel", | ||
"submodelElements": [ | ||
{ | ||
"idShort": "something3fdd3eb4", | ||
"valueType": "xs:decimal" | ||
} | ||
] | ||
} | ||
] | ||
} |
1 change: 1 addition & 0 deletions
1
...ironment/Unexpected/Unserializable/MissingModelType/Range/withoutModelType.json.exception
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Expected a model type, but none is present at: submodels[0].submodelElements[0] |
13 changes: 13 additions & 0 deletions
13
...ronment/Unexpected/Unserializable/MissingModelType/ReferenceElement/withoutModelType.json
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
{ | ||
"submodels": [ | ||
{ | ||
"id": "something_48c66017", | ||
"modelType": "Submodel", | ||
"submodelElements": [ | ||
{ | ||
"idShort": "something3fdd3eb4" | ||
} | ||
] | ||
} | ||
] | ||
} |
1 change: 1 addition & 0 deletions
1
...expected/Unserializable/MissingModelType/ReferenceElement/withoutModelType.json.exception
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Expected a model type, but none is present at: submodels[0].submodelElements[0] |
31 changes: 31 additions & 0 deletions
31
...ment/Unexpected/Unserializable/MissingModelType/RelationshipElement/withoutModelType.json
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
{ | ||
"submodels": [ | ||
{ | ||
"id": "something_48c66017", | ||
"modelType": "Submodel", | ||
"submodelElements": [ | ||
{ | ||
"first": { | ||
"keys": [ | ||
{ | ||
"type": "GlobalReference", | ||
"value": "urn:another-company01:f390f801" | ||
} | ||
], | ||
"type": "ExternalReference" | ||
}, | ||
"idShort": "something3fdd3eb4", | ||
"second": { | ||
"keys": [ | ||
{ | ||
"type": "GlobalReference", | ||
"value": "urn:an-example05:b7bf2725" | ||
} | ||
], | ||
"type": "ExternalReference" | ||
} | ||
} | ||
] | ||
} | ||
] | ||
} |
1 change: 1 addition & 0 deletions
1
...ected/Unserializable/MissingModelType/RelationshipElement/withoutModelType.json.exception
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Expected a model type, but none is present at: submodels[0].submodelElements[0] |
7 changes: 7 additions & 0 deletions
7
...edInEnvironment/Unexpected/Unserializable/MissingModelType/Submodel/withoutModelType.json
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"submodels": [ | ||
{ | ||
"id": "something_48c66017" | ||
} | ||
] | ||
} |
1 change: 1 addition & 0 deletions
1
...nment/Unexpected/Unserializable/MissingModelType/Submodel/withoutModelType.json.exception
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Required property "modelType" is missing at: submodels[0] |
13 changes: 13 additions & 0 deletions
13
...nexpected/Unserializable/MissingModelType/SubmodelElementCollection/withoutModelType.json
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
{ | ||
"submodels": [ | ||
{ | ||
"id": "something_48c66017", | ||
"modelType": "Submodel", | ||
"submodelElements": [ | ||
{ | ||
"idShort": "something3fdd3eb4" | ||
} | ||
] | ||
} | ||
] | ||
} |
1 change: 1 addition & 0 deletions
1
...Unserializable/MissingModelType/SubmodelElementCollection/withoutModelType.json.exception
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Expected a model type, but none is present at: submodels[0].submodelElements[0] |
14 changes: 14 additions & 0 deletions
14
...ment/Unexpected/Unserializable/MissingModelType/SubmodelElementList/withoutModelType.json
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
{ | ||
"submodels": [ | ||
{ | ||
"id": "something_48c66017", | ||
"modelType": "Submodel", | ||
"submodelElements": [ | ||
{ | ||
"idShort": "something3fdd3eb4", | ||
"typeValueListElement": "Entity" | ||
} | ||
] | ||
} | ||
] | ||
} |
Oops, something went wrong.