endoflife-date / endoflife.date

Informative site with EoL dates of everything
https://endoflife.date
MIT License
2.45k stars 752 forks source link

:pray: API > Always return lts (Return "False" instead of "") #1985

Closed adriens closed 1 year ago

adriens commented 1 year ago

:grey_question: Context

We are performing API driven integrations, including LTS considerations :

# java example
http https://endoflife.date/api/java.json

When it's a LTS we get this (see "lts": true):

{
        "cycle": "17",
        "eol": "2029-09-30",
        "latest": "17.0.5",
        "lts": true,
        "releaseDate": "2021-09-14",
        "support": "2026-09-30"
    }

... but it's not an LTS, we get nothing :

{
        "cycle": "18",
        "eol": "2022-09-20",
        "latest": "18.0.2.1",
        "releaseDate": "2022-03-22",
        "support": "2022-09-20"
    }

:bulb: It would be much easier for better third parties to reply something like :

{
        "cycle": "18",
        "eol": "2022-09-20",
        "latest": "18.0.2.1",
        "lts": false,
        "releaseDate": "2022-03-22",
        "support": "2022-09-20"
    }

:point_right: On the integrator side, the consequence is that we have, to properly (and effortless) manage boolean fields, to test and add false when it's not a LTS.

:pray: Feature request

captn3m0 commented 1 year ago

Could be updated here: https://github.com/endoflife-date/endoflife.date/blob/master/_plugins/create-json-files.rb

Sounds like a good idea, makes the API more consistent.

adriens commented 1 year ago

Sounds like a good idea, makes the API more consistent.

Yes, exacly, hence making client code cleaner :zap:

marcwrobel commented 1 year ago

@adriens, beware : the lts field type is either boolean or string (it can be populated with dates).

adriens commented 1 year ago

@adriens, beware : the lts field type is either boolean or string (it can be populated with dates).

Thanks a lof for pointing this, we'll have to try catch and cast so 👍

adriens commented 1 year ago

@adriens, beware : the lts field type is either boolean or string (it can be populated with dates).

Do you have some examples of products ?... and same case on eol

marcwrobel commented 1 year ago
adriens commented 1 year ago

:pray: @marcwrobel

adriens commented 1 year ago

:rocket: