Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lack of Observable gives Error in Flow Generator Plugin #30

Closed
egekorkan opened this issue Jul 29, 2024 · 2 comments
Closed

Lack of Observable gives Error in Flow Generator Plugin #30

egekorkan opened this issue Jul 29, 2024 · 2 comments

Comments

@egekorkan
Copy link
Member

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?

@hidetak
Copy link
Contributor

hidetak commented Jul 30, 2024

@egekorkan
Thank you for pointing this out.
I have made the following corrections to the PR, along with other problems I have found.
#31

I would be happy to confirm this.

@egekorkan
Copy link
Member Author

Fixed in #31

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants