modrinth / docs

Our documentation site's source code.
https://docs.modrinth.com
Creative Commons Zero v1.0 Universal
32 stars 47 forks source link

openapi: Change schema for notification ids to string #141

Closed pavog closed 9 months ago

pavog commented 9 months ago

The schema for the notification IDs in /notifications is currently defined as:

schema:
  type: array
  items:
    type: string
  example: "[\"AABBCCDD\", \"EEFFGGHH\"]"

this is wrong. It would mean that my request to fetch notifications would look like this: https://api.modrinth.com/v2/notifications?ids=vNcGR3Fd&ids=EBqEP7Kk This does not work and returns this response:

{
  "error": "invalid_input",
  "description": "Error while validating input: Query deserialize error: duplicate field `ids`"
}

This PR changes the schema for the notification IDs to string. It is actually a string, written like an array in json.

New

schema:
  type: string
  example: "[\"AABBCCDD\", \"EEFFGGHH\"]"

And the request will look like this: https://api.modrinth.com/v2/notifications?ids=["vNcGR3Fd", "EBqEP7Kk"]

Related to: