eclipse-thingweb / eclipse-thingweb/td-tools

Unit breaks OpenAPI conversion

Open
#36 3 comments 0 reactions 0 assignees View on GitHub
openapi
Dominant language
TypeScript
Stars
6
Forks
11
Avg merge
1d 15h
Merged PRs (30d)
4

Description

A TD like below results in an error when trying to convert to Open API due to presence of `unit`. Removing unit fixes the transformation.

```json
{
"@context": "https://www.w3.org/2022/wot/td/v1.1",
"title": "Coffee Machine",
"securityDefinitions": {
"nosec_sc": {
"scheme": "nosec"
}
},
"security": [
"nosec_sc"
],
"properties": {
"resources": {
"readOnly": true,
"observable": true,
"type": "object",
"properties": {
"water": {
"type": "integer",
"minimum": 10,
"maximum": 100,
"unit": "%"
}
},
"forms": [
{
"href": "http://192.168.1.112:8081/coffee-machine/properties/resources",
"contentType": "application/json",
"op": [
"readproperty"
],
"htv:methodName": "GET"
}
],
"writeOnly": false
}
},
"id": "urn:uuid:e8319e4c-ee5c-4a8b-a8f5-b2f255789431",
"description": "A simple coffee machine that can be interacted over the Internet",
"support": "https://github.com/eclipse-thingweb/node-wot/"
}
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.