telefonicaid / iotagent-node-lib

Module to enable IoT Agent developers to build custom agents for their devices that can easily connect to NGSI Context Brokers
https://iotagent-node-lib.rtfd.io/
GNU Affero General Public License v3.0
60 stars 85 forks source link

[Remove] `/iot/services` API path #1649

Open mapedraza opened 2 weeks ago

mapedraza commented 2 weeks ago

With issue https://github.com/telefonicaid/iotagent-node-lib/issues/752 and PR #1648 , the usage of API route /iot/services is deprecated, and, eventually, should be removed

Look for #FIXME1649 in the code for references that should be removed

fgalan commented 2 weeks ago

Look for #FIXME1649 in the code for references that should be removed

15 occurrences in PR #1648

fgalan commented 2 weeks ago

PR #1648 does a wrapping to use "groups" but internally "services" is still used in the code. Eg:

    callback(null, {
        count: filteredGroups.length,
        services: result
    });

instead of

    callback(null, {
        count: filteredGroups.length,
        groups: result
    });

That should be changed, the same (non-obsolete) term used in the API (groups) should be used internally in the code. The code is more maintainable if API terms and code terms are aligned.

This task should be done as part of this issue or as part of issue https://github.com/telefonicaid/iotagent-node-lib/issues/1587 (considering also the alignment with the DB model, so completing alignment API-code-DB).

fgalan commented 2 weeks ago

Maybe both #1587 and this issue should be addressed together.

mapedraza commented 2 weeks ago

Maybe both #1587 and this issue should be addressed together.

I agree. When internal datamodels align with DB models, group term should be used. At this point, work made in #1648 will not be useful anymore and code with #FIXME1649 can be deleted.

The following tasks should be addressed:

fgalan commented 2 weeks ago

Ensure also the following issues (in other repositories) has been accomplished before removing the deprecated routes: