-
Notifications
You must be signed in to change notification settings - Fork 80
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
feat(coap-server): add initial meta operation support #1086
Conversation
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## master #1086 +/- ##
==========================================
+ Coverage 75.31% 75.53% +0.22%
==========================================
Files 80 80
Lines 16060 16172 +112
Branches 1503 1519 +16
==========================================
+ Hits 12096 12216 +120
+ Misses 3925 3917 -8
Partials 39 39
☔ View full report in Codecov by Sentry. |
You are not alone at this so it can definitely be postponed: w3c/wot-thing-description#848 . However, wouldn't it be better to never generate a TD with it? |
Good point, I removed it for now alongside the node-wot/packages/binding-http/src/http-server.ts Lines 346 to 366 in 227be53
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a small comment below. Test coverage could be also improved but we can do it in a future PR.
if (readableProperties > 0) { | ||
opValues.push("readmultipleproperties"); | ||
} | ||
|
||
if (readableProperties === numberOfProperties) { | ||
opValues.push("readallproperties"); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, the spec is not clear about this semantic. One could still understand that the readallproperties operation just works on the set of readable properties of the thing. I guess for the time being is alright to leave as it is, but still other bindings implementations might act differently.
…eb#1086) * feat(coap-server): add support for property meta operations * fixup! feat(coap-server): add support for property meta operations * fixup! feat(coap-server): add support for property meta operations * test(coap-server): add basic tests for property meta operations
Based on the refactoring made in #1084, this PR adds initial support for meta operations, namely the reading of multiple or all properties, to the CoAP server. This corresponds with issue #1014 – as only one kind of meta operation is supported yet, I think the issue can be kept open for now.
I haven't figured out the correct way to implement writing multiple properties yet, which is why I left it out of this PR for now. However, a method skeleton already exists (at the moment, it simply returns an error response with code
5.01
(Not Implemented)) which can be expanded in a follow-up PR.As this PR depends on #1084, I will rebase once that PR has been merged to make reviewing a bit easier. Until then, I will keep this PR in draft status.