Wot-thing-description: Add "multipleOf" term to NumberSchema and IntegerSchema

Created on 5 Nov 2019  路  6Comments  路  Source: w3c/wot-thing-description

It is ideal if we could indicate the resolution of number properties, such as "targetTemperature" of HVAC being specified in 0.5 degrees Celsius step.
JSON Schema already has "multipleOf" keyword for numeric types, so it is desirable to incorporate it to NumberSchema and IntegerSchema in future TD version.

Propose closing JSON Schema

Most helpful comment

Part of such TD looks like this:

{
  ...
  "properties": {
    "targetTemperature": {
      "type": "number", 
      "minimum": 16, 
      "maximum": 30, 
      "multipleOf": 0.5
    }
  }
  ...
}

All 6 comments

The current TD spec allows addition of such extra words that would be parsed by a JSON Schema library. Could you provide example implementation TDs that make use of this?

Part of such TD looks like this:

{
  ...
  "properties": {
    "targetTemperature": {
      "type": "number", 
      "minimum": 16, 
      "maximum": 30, 
      "multipleOf": 0.5
    }
  }
  ...
}

In 2019-11-08 TD telecon, it was suggested to support this in the next version of TD spec.

@takuki Thanks a lot!

PR is merged

In the call of 12.05.2021, we have decided to close this issue

Was this page helpful?
0 / 5 - 0 ratings

Related issues

JKRhb picture JKRhb  路  5Comments

jmcanterafonseca picture jmcanterafonseca  路  8Comments

egekorkan picture egekorkan  路  4Comments

zolkis picture zolkis  路  5Comments

mlagally picture mlagally  路  9Comments