Skip to content

Commit

Permalink
Revert the 404 JSON redirect rule (#2425)
Browse files Browse the repository at this point in the history
  • Loading branch information
marcwrobel committed Mar 6, 2023
1 parent 00811fc commit 4db88ac
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 11 deletions.
18 changes: 13 additions & 5 deletions CHANGELOG_API.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,34 +8,42 @@ On 2023-03-02 endpoints were:

## API v1 beta

### Summary

This is a major rework of the API with a lot of breaking changes. Compared the API v0, API v1:

- is generated using a Jekyll Generator (see https://jekyllrb.com/docs/plugins/generators/),
- is versioned using the api/v1 prefix (https://github.com/endoflife-date/endoflife.date/issues/2066).
- is versioned using the api/v1 prefix (#2066).
This will make it easier to implement non-backward-compatible changes in API,
- feels more "Restful".

The API v0 is still generated to give time to users to migrate to API v1.

Changes in the "All products" endpoint:
### Changes in the "All products" endpoint

- Path has been changed from `api/all.json` to `api/v1/products/`
- Response has been changed from a simple array to a JSON document. This made it possible to add endoflife-level data, such as the number of products.
- Array elements have been changed from a simple string to a full JSON document. This made it possible to expose new data, such as product category and tags (#2062).

Changes in the "Product" endpoint:
### Changes in the "Product" endpoint

- Path has been changed from `api/<product>.json` to `api/v1/products/<product>/`.
- Response has been changed from a simple array to a JSON document. This made it possible to expose product-level data, such as product category and tags (#2062).
- Cycles data now always contain all the release cycles properties, even if they are null (example: `discontinued`, `latest`, `latestReleaseDate`, `support`...).

Changes in the "Cycle" endpoint:
### Changes in the "Cycle" endpoint

- Path has been changed from `api/<product>/<cycle>.json` to `api/v1/products/<product>/cycles/<cycle>/`.
- Cycles data now always contain all the release cycles properties, even if they are null (example: `discontinued`, `latest`, `latestReleaseDate`, `support`...).
- A special `/api/v1/products/<product>/cycles/latest/` cycle, containing the same data as the latest cycle, has been added (#2078).

New endpoints :
### Changes in 404 error responses

404 error JSON responses are not returned anymore. #2425 has been reverted because it conflicted
with the rule that rewrite the paths to add `/index.json` to all requests, which is also a global
rule and [takes precedence](https://docs.netlify.com/routing/redirects/#rule-processing-order).

### New endpoints

- `/api/v1/categories/` - list categories used on endoflife.date
- `/api/v1/categories/<category>` - list products having the given category
Expand Down
3 changes: 0 additions & 3 deletions _redirects
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,3 @@ layout: null
{%- endif %}

{% endfor %}

# Send a JSON response for 404 in API
/api/* /assets/404.json 404
3 changes: 0 additions & 3 deletions assets/404.json

This file was deleted.

0 comments on commit 4db88ac

Please sign in to comment.