Skip to content
This repository has been archived by the owner on Jun 13, 2019. It is now read-only.

findResource API does not filter resources with options.resourceTypes #139

Open
ttzeng opened this issue Jun 21, 2017 · 4 comments
Open

Comments

@ttzeng
Copy link
Contributor

ttzeng commented Jun 21, 2017

Per the findResources API, I thought passing options.resourceTypes argument to findResources() can discover only the desired resource type, but the following code snippet still got all resource in the foundResource listener. Is this valid?

client.on("error", serverError)
          .findResources({ resourceTypes: [ 'no_such_resource' ] }, foundResource).then(
@nagineni
Copy link

nagineni commented Sep 4, 2017

@ttzeng, try changing property name resourceTypes to resourceType. I recently checked this query-oriented discovery and it was working fine for me.

https://github.com/01org/iot-js-api/blob/ocf-1.1.0/api/ocf/client.md#35-the-findresourcesoptions-listener-method

@ttzeng
Copy link
Contributor Author

ttzeng commented Sep 7, 2017

Thanks @nagineni , it works. It really discovers the desired resource type in the given string array, so it seems a property name typo and will be fixed in future commit?

@zolkis
Copy link
Contributor

zolkis commented Sep 11, 2017

@ttzeng did you mean to fix the spec, i.e. resourceType should actually be resourceTypes and require it to be an array?

@ttzeng
Copy link
Contributor Author

ttzeng commented Sep 11, 2017

@zolkis sorry for my misled. I meant the property name resourceType_s_ in the Spec right refers a array of strings, but it sounds a typo in the iotivity-node implementation, so I was wondering whether it will be fixed in future iotivity-node revisions?

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

No branches or pull requests

3 participants