openhab-core
openhab-core copied to clipboard
Dimension in `thing-description-1.0.0.xsd`
I randomly noticed that there is a list of dimensions in thing-description-1.0.0.xsd:
https://github.com/openhab/openhab-core/blob/c9ee9920478c783ea4f40dacab79ea41569ef505/bundles/org.openhab.core.thing/schema/thing/thing-description-1.0.0.xsd#L201-L250
This list hasn't been updated for a while, for example the following are missing:
- DataAmount introduced in #681
- EmissionIntensity introduced in #4069
- EnergyPrice introduced in #3503
- RadiationSpecificActivity introduced in #3608
and probably others as well.
But then I validated a thing type definition containing one of those, and it passed. Apparently dimension is not used at all, since item-type is defined as xs:string:
https://github.com/openhab/openhab-core/blob/c9ee9920478c783ea4f40dacab79ea41569ef505/bundles/org.openhab.core.thing/schema/thing/thing-description-1.0.0.xsd#L66
So I'm wondering: Should it even be in the file? Is it a left-over, or deliberately kept for some sort of legacy backwards compatibility?
Expected Behavior
I would expect dimension to be either maintained and used, or not in the XSD at all.
Current Behavior
The XSD contains a definition for dimension, but apparently it is not used.
Possible Solution
Remove it from the XSD, if this is feasible without breaking compatibility and/or requiring a new version, which might complicate things.
Given https://github.com/openhab/openhab-webui/pull/2485 I would say to remove it. And as it seems never to have been used anyway, there would seem to be little risk of breaking anything..
In my opinion the <xs:element name="item-type" type="xs:string" minOccurs="0"/>should be fixed.