-
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: add initial requestThingDescription implementation #1166
feat: add initial requestThingDescription implementation #1166
Conversation
5a267b6
to
cd96956
Compare
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## master #1166 +/- ##
==========================================
- Coverage 76.67% 76.33% -0.35%
==========================================
Files 80 80
Lines 16625 16827 +202
Branches 1603 1616 +13
==========================================
+ Hits 12748 12845 +97
- Misses 3847 3952 +105
Partials 30 30 ☔ View full report in Codecov by Sentry. |
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.
I would fix Ege's point and I left a couple of comments below. Moreover, I wondering if we can somehow track the different TODOs comments before merging. Maybe when we reched two accepts we can create the issues and do a quick update of the comments with a link to the issues? Finally, maybe I missed why there is so much discrepancy between coaps
and coap
implementation?
e4fad1f
to
3a7c741
Compare
That is actually because we are currently using two different libraries for CoAP ( |
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.
I think for an initial implementation it is fine as is.
I added some comments below
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.
LGTM
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.
Good enough for now. Let's improve it with future iterations!
This PR adds an initial implementation for the
requestThingDescription
method.The implementation details probably still need some additional discussion – looking forward to your feedback here :) For now, I extended the
ProtocolClient
interface with a newrequestThingDescription
method that is expected to return aContent
object that is deserialized and (supposed to be ) validated by theWoT
implementation.I think this latter part also touches #1055 – in my opinion, there should be some validation happening so that library users can be sure that they always receive a valid Thing Description. Maybe the algorithm(s) in the Scripting API would need to be adjusted then as well.
For now, I only implemented the protocol-specific
requestThingDescription
method for HTTP and CoAP, if the general design works for you more protocols could be added in follow-up PRs.