Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

API Docs have wrong properties for platform type / enum #1269

Closed
pavog opened this issue Sep 6, 2023 · 1 comment
Closed

API Docs have wrong properties for platform type / enum #1269

pavog opened this issue Sep 6, 2023 · 1 comment
Assignees
Labels
1. api This issue/pr relates to an issue/change on the api 1. bug Something isn't working

Comments

@pavog
Copy link

pavog commented Sep 6, 2023

Observed/problematic behavior

The automatically generated openapi specification file for Hangars API contains an error for the Platform type.
It is defined the following way:

    Platform:
      maxLength: 3
      minLength: 1
      type: string
      description: Server platform
      example: PAPER
      enum:
      - PAPER
      - WATERFALL
      - VELOCITY

The problem here are: maxLength and minLength.
These two properties simply do not belong here.
It also makes it impossible to use the download endpoint (/api/v1/projects/{slug}/versions/{name}/{platform}/download) using the ui for the api-docs (https://hangar.papermc.io/api-docs#/Versions/downloadVersion).

See the attached screenshot:
image

Expected behavior

I should be able to choose all 3 platforms (PAPER, WATERFALL or VELOCITY) on the UI and don't get an error.
The properties maxLength and minLength for Platform should not be in the generated open api specification file.

Steps to reproduce

  1. Go to https://hangar.papermc.io/api-docs#/Versions/downloadVersion
  2. Click "Try it out"
  3. Enter a project slug. Example: ViaVersion
  4. Enter a version name. Example: 4.8.0-1.20.2-pre1-SNAPSHOT+14
  5. Choose a platform. Example: PAPER
  6. Click "Execute"

Other

No response

@kennytv kennytv added 1. bug Something isn't working 1. api This issue/pr relates to an issue/change on the api labels Sep 6, 2023
@kennytv kennytv closed this as completed in 5bc5249 Sep 6, 2023
@github-project-automation github-project-automation bot moved this from New to ✅ Done in Hangar Roadmap Sep 6, 2023
@kennytv kennytv self-assigned this Sep 6, 2023
@pavog
Copy link
Author

pavog commented Sep 6, 2023

Thank you! :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1. api This issue/pr relates to an issue/change on the api 1. bug Something isn't working
Projects
Status: Done
Development

No branches or pull requests

2 participants