Media list endpoints have incorrect OpenAPI (previously Swagger) example definitions #4885
Labels
💻 aspect: code
Concerns the software code in the repository
🤖 aspect: dx
Concerns developers' experience with the codebase
🛠 goal: fix
Bug fix
🟧 priority: high
Stalls work on the project or its dependents
🧱 stack: api
Related to the Django API
🐍 tech: python
Involves Python
Description
Our API uses an OpenAPI schema, which can be viewed here:
https://api.openverse.org/v1/schema/?format=json (exclude the format param for yaml)
The examples for the
/v1/audio/
and/v1/images/
paths are incorrect. This might be easiest to view locally like so:http https://api.openverse.org/v1/schema/\?format\=json | jq '.paths."/v1/images/".get.responses."200".content."application/json".examples.OK'
You'll see a similar result for the audio path at
http https://api.openverse.org/v1/schema/\?format\=json | jq '.paths."/v1/audio/".get.responses."200".content."application/json".examples.OK'
As you can see, the results array is incorrectly nested. This is problematic because various codegen tools, API consumers, and so on rely on this spec for their own work, and inaccurate examples could prevent code generation and/or give false impressions of the workings of the API.
Additional context
The text was updated successfully, but these errors were encountered: