[PR #184] [CLOSED] Improve API consistency #530

Closed
opened 2026-02-25 23:34:37 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/go-shiori/shiori/pull/184
Author: @disposedtrolley
Created: 9/29/2019
Status: Closed

Base: masterHead: api-consistency


📝 Commits (6)

  • c439801 feat: rename PUT /api/tag to /api/tags
  • 57a31d7 feat: add envelope for GET /api/tags response
  • 1ea45f8 feat: add envelope for GET /api/accounts response
  • 40a597b fix: update status code to 204 for empty responses
  • 586e308 chore: generate new frontend bundle
  • ecc7f52 fix: don't parse empty response as JSON

📊 Changes

6 files changed (+88 additions, -83 deletions)

View changed files

📝 docs/postman/shiori.postman_collection.json (+3 -3)
📝 internal/view/js/page/home.js (+2 -5)
📝 internal/view/js/page/setting.js (+1 -1)
📝 internal/webserver/assets-prod.go (+64 -64)
📝 internal/webserver/handler-api.go (+17 -9)
📝 internal/webserver/server.go (+1 -1)

📄 Description

Hello again!

This PR improves some of the resource APIs to be more aligned with REST best practices. It:

  • adds response envelopes for several endpoints which had top-level JSON arrays
  • ⚠️ Breaking change: changes responses containing a 1 in the body to return a 204 No Content status with an empty body instead
  • ⚠️ Breaking change: renames the PUT /api/tag endpoint to /api/tags
  • updates the Postman collection

I've also generated a new bundle for the frontend since some of the API changes required changes to the associated JS files.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/go-shiori/shiori/pull/184 **Author:** [@disposedtrolley](https://github.com/disposedtrolley) **Created:** 9/29/2019 **Status:** ❌ Closed **Base:** `master` ← **Head:** `api-consistency` --- ### 📝 Commits (6) - [`c439801`](https://github.com/go-shiori/shiori/commit/c4398013dbd1f66b36ef7da233cf9d8c87810b37) feat: rename PUT /api/tag to /api/tags - [`57a31d7`](https://github.com/go-shiori/shiori/commit/57a31d7ac561c4e686a82881a1aecde5175a7c2c) feat: add envelope for GET /api/tags response - [`1ea45f8`](https://github.com/go-shiori/shiori/commit/1ea45f82249e1dda1262e88becbdbeb26d3ebfd5) feat: add envelope for GET /api/accounts response - [`40a597b`](https://github.com/go-shiori/shiori/commit/40a597bee2ea97ffc0ac5fbe1cec3990ab0e9b31) fix: update status code to 204 for empty responses - [`586e308`](https://github.com/go-shiori/shiori/commit/586e3088d38c89e54611a589b73ed04ff43551b6) chore: generate new frontend bundle - [`ecc7f52`](https://github.com/go-shiori/shiori/commit/ecc7f52091313492dc91c2482f4d60b671d4726d) fix: don't parse empty response as JSON ### 📊 Changes **6 files changed** (+88 additions, -83 deletions) <details> <summary>View changed files</summary> 📝 `docs/postman/shiori.postman_collection.json` (+3 -3) 📝 `internal/view/js/page/home.js` (+2 -5) 📝 `internal/view/js/page/setting.js` (+1 -1) 📝 `internal/webserver/assets-prod.go` (+64 -64) 📝 `internal/webserver/handler-api.go` (+17 -9) 📝 `internal/webserver/server.go` (+1 -1) </details> ### 📄 Description Hello again! This PR improves some of the resource APIs to be more aligned with REST best practices. It: - adds response envelopes for several endpoints which had top-level JSON arrays - :warning: **Breaking change:** changes responses containing a `1` in the body to return a `204 No Content` status with an empty body instead - :warning: **Breaking change:** renames the `PUT /api/tag` endpoint to `/api/tags` - updates the Postman collection I've also generated a new bundle for the frontend since some of the API changes required changes to the associated JS files. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-02-25 23:34:37 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/shiori#530
No description provided.