Skip to content

Check data schema algorithm and strings #240

Open
@relu91

Description

@relu91

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:

{
   "name":"Jhon",
   // .... other properties
}

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 }"

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugError, flaw or fault in the specification that causes misunderstandings and/or incorrect/unexpectedfor next iterationPlanned or postponed topics for the futurevalidationRelates to how to conform to a given set of rules (e.g., data validation, conformance)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions