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

Align category API with other APIs #3036

Closed
teemukataja opened this issue Sep 13, 2022 · 4 comments · Fixed by #3046
Closed

Align category API with other APIs #3036

teemukataja opened this issue Sep 13, 2022 · 4 comments · Fixed by #3046
Assignees

Comments

@teemukataja
Copy link

teemukataja commented Sep 13, 2022

Is your feature request related to a problem? Please describe.
The different APIs follow a distinct pattern POST /api/{item}/create:

POST /api/applications/create
POST /api/licenses/create
POST /api/forms/create
POST /api/resources/create
POST /api/catalogue-items/create

We are programmatically creating items using the pattern /api/{item}/create and would like to be able to use the same pattern with categories as well, but at the moment its API is slightly different from the others.

Describe the solution you'd like
Update categories API to follow the same convention as other APIs.

POST /api/categories/create

instead of

POST /api/categories

The following is not important to us, but the same can be seen in updating items:

PUT /api/categories

vs

PUT /api/{items}/edit

Additional context
GET already works the same for all items. 👍

GET /api/{item}
GET /api/{item}/{item-id}
@teemukataja teemukataja added the Needs Triage A new issue that needs looking at and triage. label Sep 13, 2022
@Macroz
Copy link
Collaborator

Macroz commented Sep 14, 2022

Looks good. A consistent API is desireable.

The categories API is perhaps more consistent with typical REST practices, but our CQRS style with commands is perhaps the one we should follow (with /create and /edit). We can add these and keep the old ones for backwards compatibility for now.

@Macroz Macroz added Enhancement and removed Needs Triage A new issue that needs looking at and triage. labels Sep 14, 2022
@aatkin
Copy link
Collaborator

aatkin commented Sep 26, 2022

We could also change organizations API PUT /edit into POST /edit for consistency.

@Macroz Macroz self-assigned this Sep 26, 2022
@Macroz
Copy link
Collaborator

Macroz commented Sep 26, 2022

Actually, it seems we have all the edits as PUT so the org should remain. But I noticed PUT /api/user-settings needs the /edit too.

@Macroz Macroz mentioned this issue Sep 26, 2022
6 tasks
@Macroz Macroz added this to the API Improvements milestone Sep 26, 2022
@Macroz
Copy link
Collaborator

Macroz commented Sep 27, 2022

@teemukataja This is now merged to master, if you want to test it already. It should appear in the next release in a while.

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

Successfully merging a pull request may close this issue.

3 participants