-
-
Notifications
You must be signed in to change notification settings - Fork 804
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
This is a major rework of the API with a lot of breaking changes. Compared the the old API v0, API v1: - is generated using a Jekyll Generator (see https://jekyllrb.com/docs/plugins/generators/), - is versioned using the api/v1 prefix (#2066) and a schema_version field (#2331). This will make it easier to implement non-backward-compatible changes in API, - feels more "Restful", - and expose most of the products / tags / categories data (#2062, #2595) The API v0 is still generated to give time to users to migrate to API v1. It will be removed a year or more. The only change is that the 404 JSON redirect rule had to be reverted because of incompatibilities with API v1 own redirect rules (#2425). The API v1 documentation is available at /docs/api/v1/, but the tool used for the documentation is now swagger-ui. It fixed the issues we had with stoplight webcomponent on CSP, code example generation and icon on Firefox ESR (#1762). But swagger-ui imposed the downgrade of OpenAPI version from 3.1.0 to 3.0.3. Changes between the two versions has been documented in the API_CHANGELOG.md files. Note that we thought of disabling API generation in development (using JEKYLL_ENV like the Jekyll Feed plugin - see https://github.com/jekyll/jekyll-feed/blob/master/lib/jekyll-feed/generator.rb#L145), but it was finally reverted. It does not work well with Netlify preview, and generate production URL (i.e. https://endoflife.date URLs) in development which makes it difficult to use.
- Loading branch information
1 parent
fd0ae52
commit 30f7546
Showing
16 changed files
with
828 additions
and
89 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
## API v1.0.0 | ||
|
||
### Summary | ||
|
||
API v1 is a major rework of the API v0 with a lot of breaking changes. Compared to the API v0, API v1: | ||
|
||
- feels more "Restful", | ||
- is versioned using the `api/v1` prefix, making it easier to implement non-backward-compatible | ||
changes, | ||
- is generated using a Jekyll Generator (see https://jekyllrb.com/docs/plugins/generators/). | ||
|
||
API v1 resolves : #394, #759, #905, #2062, #2066, #2078, #2160, #2331, #2431, #2595. It also reverts | ||
#2425 due to incompatibilities in redirect rules. | ||
|
||
The API v0 is still generated to give time to users to migrate to API v1. | ||
|
||
### 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 | ||
|
||
- 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 | ||
|
||
- 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). | ||
|
||
### Changes in 404 error responses | ||
|
||
404 error JSON responses are not returned anymore. #2425 has been reverted because it conflicted | ||
with the rule that rewrites 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 | ||
- `/api/v1/tags/` - list tags used on endoflife.date | ||
- `/api/v1/tags/<tag>` - list products having the given tag | ||
|
||
|
||
|
||
## API v0 | ||
|
||
On 2023-03-02 the v0 endpoints were: | ||
|
||
- "All products" (`/api/all.json`) : Return a list of all products. | ||
- "Product" (`/api/{product}.json`) : Get EoL dates of all cycles for a given product. | ||
- "Cycle" (`/api/{product}/{cycle}.json`) : Details of a single release cycle of a given product. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{{ page.data | jsonify }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
--- | ||
layout: null | ||
--- | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8"> | ||
<title>{{ page.title }}</title> | ||
|
||
<link rel="stylesheet" type="text/css" href="https://unpkg.com/swagger-ui-dist@3/swagger-ui.css"> | ||
</head> | ||
|
||
<body> | ||
<div id="swagger-ui"></div> | ||
|
||
<script src="https://unpkg.com/swagger-ui-dist@3/swagger-ui-bundle.js"></script> | ||
<script src="https://unpkg.com/swagger-ui-dist@3/swagger-ui-standalone-preset.js"></script> | ||
<script> | ||
window.onload = function () { | ||
const ui = SwaggerUIBundle({ | ||
url: "{{ page.openapi_yml | absolute_url }}", | ||
dom_id: '#swagger-ui', | ||
deepLinking: true, | ||
presets: [SwaggerUIBundle.presets.apis, SwaggerUIStandalonePreset], | ||
plugins: [SwaggerUIBundle.plugins.DownloadUrl], | ||
layout: "BaseLayout" | ||
}) | ||
} | ||
</script> | ||
</body> | ||
</html> |
Oops, something went wrong.