Skip to content

Lack of Observable gives Error in Flow Generator Plugin #30

@egekorkan

Description

@egekorkan

Taking a TD with a property without observable, reports a JSON parse error at TD insertion (see screenshot below):

image

Tracing it to the function:

error: SyntaxError: JSON.parse: unexpected character at line 81 column 20 of the JSON data
replaceParamsAndIds http://localhost:1880/resources/@thingweb/node-red-node-wot/node-wot-plugin-lib.js:154
makePropertyFlow http://localhost:1880/resources/@thingweb/node-red-node-wot/node-wot-plugin-lib.js:169
createClientFlowUsingDashboard http://localhost:1880/resources/@thingweb/node-red-node-wot/node-wot-plugin-lib.js:83

Example TD:

{
    "@context": "https://www.w3.org/2022/wot/td/v1.1",
    "@type": "Thing",
    "title": "Smart Clock",
    "securityDefinitions": {
        "nosec_sc": {
            "scheme": "nosec"
        }
    },
    "security": [
        "nosec_sc"
    ],
    "properties": {
        "time": {
            "readOnly": true,
            "type": "object",
            "properties": {
                "minute": {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 59
                },
                "hour": {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 23
                }
            },
            "forms": [
                {
                    "href": "coap://localhost:5686/smart-clock/properties/time",
                    "contentType": "application/json",
                    "op": [
                        "observeproperty",
                        "unobserveproperty"
                    ],
                    "subprotocol": "cov:observe"
                }
            ],
            "writeOnly": false
        }
    },
    "id": "urn:uuid:ac327610-31f5-4083-abf1-3730dbb59b1f",
    "description": "a smart clock that runs 60 times faster than real time, where 1 hour happens in 1 minute.",
}

@hidetak can you have a look?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions