Skip to content
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

Add new /iot/groups API route #1648

Merged
merged 7 commits into from
Aug 26, 2024
Merged

Add new /iot/groups API route #1648

merged 7 commits into from
Aug 26, 2024

Conversation

mapedraza
Copy link
Collaborator

@mapedraza mapedraza commented Aug 23, 2024

This PR solves #752
This PR overpasses #1637

  • Code
  • Tests
  • Doc

@mapedraza mapedraza changed the title Add new /iot/groups API route [WIP] Add new /iot/groups API route Aug 23, 2024
Comment on lines 275 to 286
'/iot/services',
restUtils.checkRequestAttributes('headers', mandatoryHeaders),
restUtils.checkBody(templateGroupService),
handleCreateDeviceGroup
);

router.post(
'/iot/groups',
restUtils.checkRequestAttributes('headers', mandatoryHeaders),
restUtils.checkBody(templateGroup),
handleCreateDeviceGroup
);
Copy link
Collaborator Author

@mapedraza mapedraza Aug 23, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note: Needed 2 router.post() entries in order to allow to use a different template for each query
NTD.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I got that. Maybe CheckBody should take care of it. If it can do comlex checkings.

Copy link
Member

@mrutid mrutid Aug 24, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"revalidator" dependency doesn't allow conditional checking. The point here is that limits on auxiliar libs shouldn't drive to special "code structures" at the top level code. Top Level code is more important than a limited validation library. I think uniformity at this level is more important than check two options of JSON (probably this can be achieved by using async.some module already required)

@mapedraza mapedraza changed the title [WIP] Add new /iot/groups API route Add new /iot/groups API route Aug 26, 2024
@fgalan
Copy link
Member

fgalan commented Aug 26, 2024

The following should be added to CHANGES_NEXT_RELEASED (as in PR #1637):

- Add /iot/groups API endpoints (as equivalent to /iot/services) (#752)
- Deprecated: /iot/services API routes

mapedraza and others added 3 commits August 26, 2024 12:49
Co-authored-by: Fermín Galán Márquez <fgalan@users.noreply.github.com>
Co-authored-by: Fermín Galán Márquez <fgalan@users.noreply.github.com>
Copy link
Member

@fgalan fgalan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@mrutid mrutid merged commit 1bef950 into master Aug 26, 2024
8 checks passed
Copy link
Member

@mrutid mrutid left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

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

Successfully merging this pull request may close these issues.

3 participants