The const validator in json schema is (similar to enum) used to specify that a specific property can only contain a single constant value. This isn’t implemented in losant (while enum does work as expected),
If I setup the following json schema:
{
"type": "object",
"properties": {
"const_test": {
"const": "const value"
},
"enum_test": {
"enum": ["valid1","valid2","valid3"]
}
}
}
and then send it this payload:
{
"const_test": "wrong const value",
"enum_test": "valid1"
}
It validates just fine, while it shouldn’t, as can be seen here: Newtonsoft