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

MG-2053 : Structure API Endpoints Based on Entities #2195

Open
wants to merge 9 commits into
base: main
Choose a base branch
from

Conversation

WashingtonKK
Copy link
Contributor

What type of PR is this?

This is a refactor because it changes the naming and structuring of API endpoints.

What does this do?

This restructures API endpoints so that they are named based on entities such as groups, channels, users, things etc.

Which issue(s) does this PR fix/relate to?

Have you included tests for your changes?

No, I have not included tests.

Did you document any new/modified feature?

Yes, I have updated the documentation for the new feature.

Notes

@WashingtonKK WashingtonKK self-assigned this Apr 22, 2024
api/openapi/auth.yml Outdated Show resolved Hide resolved
api/openapi/auth.yml Outdated Show resolved Hide resolved
users/api/groups.go Outdated Show resolved Hide resolved
users/api/clients.go Outdated Show resolved Hide resolved
Copy link
Member

@rodneyosodo rodneyosodo left a comment

Choose a reason for hiding this comment

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

Some endpoints have not been updated on the SDK for example

  • channels/users/userID
  • channesl/groups/groupID
  • groups/channels/channelID
  • users/domains/domainID

pkg/sdk/go/domains.go Outdated Show resolved Hide resolved
pkg/sdk/go/channels.go Outdated Show resolved Hide resolved
pkg/sdk/go/channels.go Outdated Show resolved Hide resolved
users/api/clients.go Outdated Show resolved Hide resolved
users/api/clients.go Outdated Show resolved Hide resolved
things/api/http/clients.go Outdated Show resolved Hide resolved
pkg/sdk/go/groups.go Outdated Show resolved Hide resolved
Copy link
Member

@rodneyosodo rodneyosodo left a comment

Choose a reason for hiding this comment

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

For SDK changes add tests to make sure they work

things/api/http/endpoints_test.go Outdated Show resolved Hide resolved
api/openapi/users.yml Outdated Show resolved Hide resolved
pkg/sdk/go/users.go Outdated Show resolved Hide resolved
pkg/sdk/go/channels.go Outdated Show resolved Hide resolved
@WashingtonKK WashingtonKK force-pushed the MG-2053 branch 2 times, most recently from 7815468 to 6b9cec8 Compare May 8, 2024 16:27
pkg/sdk/go/things.go Outdated Show resolved Hide resolved
Copy link
Contributor

@felixgateru felixgateru left a comment

Choose a reason for hiding this comment

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

Consider updating the sdk.go with updated documentation for the new sdk functions. Also you can regenerate the mocks after making changes to the interface.

@WashingtonKK
Copy link
Contributor Author

Consider updating the sdk.go with updated documentation for the new sdk functions. Also you can regenerate the mocks after making changes to the interface.

It is already up to date @1998-felix

felixgateru
felixgateru previously approved these changes May 23, 2024
Copy link
Contributor

@felixgateru felixgateru left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Member

@rodneyosodo rodneyosodo left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Member

@rodneyosodo rodneyosodo left a comment

Choose a reason for hiding this comment

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

Regarding the conversation that was held change this to use query parameters for example

/channels/things/thingID to /channels?thing=<id>

Copy link
Contributor

@arvindh123 arvindh123 left a comment

Choose a reason for hiding this comment

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

At present we have /things/thingID/channels to list channels
After this PR #2195 it will be like
/channels/things/thingID to list channels
which doesn't looks good and ideal

I have discussed this with @dborovcanin , He proposed like this /channels?thing=<id>

I agree with his proposal,

Already we are having /channels which is used for listing all channels,
/channels?thing=<id> can be used to listing channels of particular thing id.
/channels?user=<id> can be used to listing channels of particular user id.
and so on.

internal/api/common.go Outdated Show resolved Hide resolved
users/api/clients.go Outdated Show resolved Hide resolved
internal/groups/api/decode.go Outdated Show resolved Hide resolved
@WashingtonKK WashingtonKK force-pushed the MG-2053 branch 2 times, most recently from 50a7944 to 4f9abae Compare June 11, 2024 07:51
api/openapi/things.yml Outdated Show resolved Hide resolved
api/openapi/things.yml Outdated Show resolved Hide resolved
api/openapi/users.yml Outdated Show resolved Hide resolved
pkg/sdk/go/users.go Outdated Show resolved Hide resolved
pkg/sdk/go/users.go Outdated Show resolved Hide resolved
pkg/sdk/go/users.go Outdated Show resolved Hide resolved
Signed-off-by: WashingtonKK <washingtonkigan@gmail.com>

update api docs

Signed-off-by: WashingtonKK <washingtonkigan@gmail.com>

fix: ci

Signed-off-by: WashingtonKK <washingtonkigan@gmail.com>

refactor tests

Signed-off-by: WashingtonKK <washingtonkigan@gmail.com>

update sdk

Signed-off-by: WashingtonKK <washingtonkigan@gmail.com>

update sdk

Signed-off-by: WashingtonKK <washingtonkigan@gmail.com>

refactor: api docs and sdk

Signed-off-by: WashingtonKK <washingtonkigan@gmail.com>

fix: api docs'

Signed-off-by: WashingtonKK <washingtonkigan@gmail.com>

update sdk and docs

Signed-off-by: WashingtonKK <washingtonkigan@gmail.com>

update groups sdk and docs

Signed-off-by: WashingtonKK <washingtonkigan@gmail.com>

feeat(groups): add groups sdk tests

Signed-off-by: WashingtonKK <washingtonkigan@gmail.com>

feat(sdk): tests

Signed-off-by: WashingtonKK <washingtonkigan@gmail.com>

fix: sdk tests

Signed-off-by: WashingtonKK <washingtonkigan@gmail.com>

feat(users): add api tests

Signed-off-by: WashingtonKK <washingtonkigan@gmail.com>

fix(api tests): add missing tests

Signed-off-by: WashingtonKK <washingtonkigan@gmail.com>

fix: users api tests

Signed-off-by: WashingtonKK <washingtonkigan@gmail.com>

fix: ci

Signed-off-by: WashingtonKK <washingtonkigan@gmail.com>
Signed-off-by: WashingtonKK <washingtonkigan@gmail.com>

fix domain endpoint tests

Signed-off-by: WashingtonKK <washingtonkigan@gmail.com>

fix tests

Signed-off-by: WashingtonKK <washingtonkigan@gmail.com>

update sdk

Signed-off-by: WashingtonKK <washingtonkigan@gmail.com>
Signed-off-by: WashingtonKK <washingtonkigan@gmail.com>
Signed-off-by: WashingtonKK <washingtonkigan@gmail.com>

fix: ci

Signed-off-by: WashingtonKK <washingtonkigan@gmail.com>

tmp

Signed-off-by: WashingtonKK <washingtonkigan@gmail.com>
Signed-off-by: WashingtonKK <washingtonkigan@gmail.com>

ci

Signed-off-by: WashingtonKK <washingtonkigan@gmail.com>
Signed-off-by: WashingtonKK <washingtonkigan@gmail.com>
Signed-off-by: WashingtonKK <washingtonkigan@gmail.com>
Signed-off-by: WashingtonKK <washingtonkigan@gmail.com>
Signed-off-by: WashingtonKK <washingtonkigan@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Todo
4 participants