Skip to content
This repository was archived by the owner on Oct 19, 2024. It is now read-only.

Conversation

@pavog
Copy link
Contributor

@pavog pavog commented Nov 24, 2023

The schema for the version IDs in /versions is currently defined as:

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

this is wrong.
It would mean that a request to fetch multiple versions would look like this:
https://api.modrinth.com/v2/versions?ids=wKkoqHrH&ids=Ojp3IEa8
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 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/versions?ids=["vNcGR3Fd", "EBqEP7Kk"]

Related to:

@triphora triphora merged commit 1572486 into modrinth:master Dec 2, 2023
@pavog pavog deleted the patch-7 branch December 4, 2023 09:47
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants