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 23, 2023

The schema loaders and game_versions in the endpoint /project/{id|slug}/version are currently defined as:

        - in: query
          name: loaders
          required: false
          description: The types of loaders to filter for
          schema:
            type: array
            items:
              type: string
            example: '["fabric"]'
        - in: query
          name: game_versions
          required: false
          description: The game versions to filter for
          schema:
            type: array
            items:
              type: string
            example: '["1.18.1"]'

this is wrong.
It would mean that my request to list project versions would look like this:
https://api.modrinth.com/v2/project/Ojp3IEa8/version?loaders=paper&loaders=spigot&game_versions=1.20.1&game_versions=1.20.2
This does not work and returns this response:

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

This PR changes the schema type for loaders and game_versions to string.
It is actually a string, written like an array in json.

New

        - in: query
          name: loaders
          required: false
          description: The types of loaders to filter for
          schema:
            type: string
            example: '["fabric"]'
        - in: query
          name: game_versions
          required: false
          description: The game versions to filter for
          schema:
            type: string
            example: '["1.18.1"]'

And the request will look like this:
https://api.modrinth.com/v2/project/smithing-table-fix/version?loaders=["paper","spigot"]&game_versions=["1.20.1","1.20.2"]

Related to #138

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