thoth-station / user-api

Web Service exposing Thoth functions to the RESTful worlds
https://thoth-station.github.io/
GNU General Public License v3.0
8 stars 18 forks source link

`/python/package/versions` endpoint should return 400 error if given package is not in database #1748

Closed mayaCostantini closed 2 years ago

mayaCostantini commented 2 years ago

Describe the bug API endpoint /python/package/versions returns a 200 status code when querying for a package which does not exist in the database:

{
  "parameters": {
    "name": "nonexistantpackage",
    "os_name": "ubi",
    "os_version": "8",
    "page": 0,
    "per_page": 100,
    "python_version": "3.8"
  },
  "versions": []
}

Environment: production.

To Reproduce Go to /python/package/versions and query for any package not present in the knowledge base.

Expected behavior Return a 400 error when no versions of a package were found in the database for a given environment.

mayaCostantini commented 2 years ago

/sig user-experience /priority critical-urgent

mayaCostantini commented 2 years ago

/assign