diff --git a/docs/api-reference/json.rst b/docs/api-reference/json.rst index cd216591551d..8fa3982cff66 100644 --- a/docs/api-reference/json.rst +++ b/docs/api-reference/json.rst @@ -167,6 +167,7 @@ Project "yanked_reason": null } ], + "versions": ["1.0", "1.2.0"], "vulnerabilities": [] } diff --git a/tests/unit/legacy/api/test_json.py b/tests/unit/legacy/api/test_json.py index b3dd1d7c4530..e3254806fa06 100644 --- a/tests/unit/legacy/api/test_json.py +++ b/tests/unit/legacy/api/test_json.py @@ -326,6 +326,7 @@ def test_renders(self, pyramid_config, db_request, db_session): } ], }, + "versions": ["0.1", "1.0", "2.0", "3.0"], "urls": [ { "comment_text": None, diff --git a/warehouse/legacy/api/json.py b/warehouse/legacy/api/json.py index 1cbe3bef43f6..1ee70c60c1ac 100644 --- a/warehouse/legacy/api/json.py +++ b/warehouse/legacy/api/json.py @@ -173,6 +173,7 @@ def _json_data(request, project, release, *, all_releases): if all_releases: data["releases"] = releases + data["versions"] = sorted(releases) return data