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

chore(food,textile,api)!: Remove deprecated API endpoints. #951

Draft
wants to merge 27 commits into
base: master
Choose a base branch
from

Conversation

n1k0
Copy link
Member

@n1k0 n1k0 commented Feb 27, 2025

🔧 Problems

🍰 Solution

  1. Remove these API endpoints which already have a POST+JSON equivalent:
    • GET /food
    • GET /textile/simulator
    • GET /textile/simulator/{impact}
    • GET /textile/simulator/detailed
  2. Update tests so they use their POST counterparts
  3. Ensure POST parameters are properly validated

⏰ Watch out

This patch clears a bunch of tech debt by introducing a dedicated, isolated layer of validation, independent from decoding.

🏝️ How to test

  • API docs should not mention the removed endpoints anymore
  • The endpoints should not respond anymore
  • Test suite should be green

@n1k0 n1k0 requested a review from vjousse February 27, 2025 09:08
@n1k0 n1k0 force-pushed the chore/deprecate-query-string-based-endpoints branch from 2348cd0 to 570c621 Compare February 27, 2025 12:56
@n1k0 n1k0 changed the title chore: deprecate textile simulator API GET endpoints. chore(food,textile,api)!: Deprecate and remove query-string based API endpoints Feb 27, 2025
@n1k0 n1k0 removed the request for review from vjousse February 27, 2025 12:58
@n1k0
Copy link
Member Author

n1k0 commented Feb 27, 2025

Updated patch, title and description to remove the query-string based endpoints completely because we don't need a deprecation step as we have API versioning to circumvent that.

@n1k0 n1k0 force-pushed the chore/deprecate-query-string-based-endpoints branch 4 times, most recently from 9d73804 to 3ae6244 Compare February 27, 2025 20:48
@n1k0 n1k0 force-pushed the chore/deprecate-query-string-based-endpoints branch from b3c579f to e0aea47 Compare March 3, 2025 08:59
@n1k0 n1k0 marked this pull request as draft March 3, 2025 09:01
@n1k0
Copy link
Member Author

n1k0 commented Mar 3, 2025

Switching back to Draft because this depends on #954 to land first.

@n1k0 n1k0 changed the title chore(food,textile,api)!: Deprecate and remove query-string based API endpoints chore(food,textile,api)!: Remove deprecated API endpoints. Mar 3, 2025
vjousse pushed a commit that referenced this pull request Mar 4, 2025
## 🔧 Problem

Query-string based API endpoints have been complicated to maintain over
time and don't provide much value over their much simpler POST+JSON
equivalent. We should deprecate these redundant GET endpoints.

Note: We'll remove them completely in the following major version to
clear redundancy and clean a bunch of tech debt along the way (work has
been started in #951).

## 🍰 Solution

Deprecate these API endpoints which already have a POST+JSON equivalent:

- `GET /food`
- `GET /textile/simulator`
- `GET /textile/simulator/{impact}`
- `GET /textile/simulator/detailed`

These will be removed in 5.0.0.

## 🏝️ How to test

Endpoints should keep working, only the documentation should denote them
as deprecated:


![image](https://github.com/user-attachments/assets/908b823e-7f72-488f-a6ee-588b193292b2)
@n1k0 n1k0 force-pushed the chore/deprecate-query-string-based-endpoints branch from e0aea47 to e89bcff Compare March 4, 2025 14:54
@n1k0 n1k0 force-pushed the chore/deprecate-query-string-based-endpoints branch from 1362e6f to 85c737c Compare March 5, 2025 09:25
@n1k0 n1k0 force-pushed the chore/deprecate-query-string-based-endpoints branch from 2b0e8ea to 92c26a1 Compare March 5, 2025 11:41
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.

1 participant