Check data schema algorithm and strings #240
Labels
bug
Error, flaw or fault in the specification that causes misunderstandings and/or incorrect/unexpected
for next iteration
Planned or postponed topics for the future
validation
Relates to how to conform to a given set of rules (e.g., data validation, conformance)
This issue is derived from my review in #239. I saw that the check data schema algorithm does not perform any check if that DataSchema is equal to
string
. In principle, I can understand why: any value in JS can be represented in a string. However, I wonder if a more strict check may make life easier for application developers.Following, the algorithm a property with
string
data schema can even return something like the following:Consequently, WoT developers should inspect beforehand if that property was mistakenly represented as a string while is actually an object. If we strictly check the type in the check data schema algorithm we mitigate this type of errors, while also maintaining the ability to return an object serialized as a string:
"{ 'name':'Jhon', // .... other properties }"
The text was updated successfully, but these errors were encountered: