aas-core-works / aas-core3.0-python

Manipulate, verify and de/serialize asset administration shells in Python.
Other
4 stars 0 forks source link

Instance deserialized although modelType is missing #32

Closed otto-ifak closed 1 week ago

otto-ifak commented 1 week ago

Shouldn't the following instance be rejected? The modelType is missing.

{
    "assetAdministrationShells": [
        {
            "extensions": [
                {
                    "name": "x"
                }
            ],
            "id": "x",
            "assetInformation": {
                "assetKind": "Instance",
                "globalAssetId": "x"
            }
        }
    ]
}
mristin commented 1 week ago

Thanks, @otto-ifak ! Indeed, it should! Since we always know the type, there is no discrimination, so the de-serialization never fired on missing model type as it never used it.

I also see that I did not include the missing modelType cases in aas-core-testgen JSON test as I only iterated over the meta-model properties, but not the additional properties not explicitly specified in the meta-model such as modelType.

Both these issues need to be fixed.

mristin commented 1 week ago

Thanks again, @otto-ifak ! Are there any more pending issues or errors you'd like to report, or should I release a new patch version of the SDK?

otto-ifak commented 18 hours ago

@mristin You are welcome. Maybe I found one more: https://github.com/aas-core-works/aas-core3.0-python/issues/37

If you could wait till the end of the week for the next release, I should be done checking for errors.

mristin commented 17 hours ago

@otto-ifak sure, let's wait, no problem at all!