HangarMC / Hangar

A plugin repository used for paper plugins
https://hangar.papermc.io/
MIT License
249 stars 65 forks source link

Try button in API docs shows 404 error caused by converted slash character in slug #1346

Closed Archy-X closed 4 months ago

Archy-X commented 4 months ago

Observed/problematic behavior

In the API docs on the website, testing any project slug (which requires a forward slash) into endpoints that takes a {slug} parameter shows a 404 error when the "Try" button is clicked to test the endpoint. The slash character is converted to "%2F" in the curl string shown, causing the project to be not found.

Expected behavior

Typing a project slug with a slash character and clicking Try should correctly test the endpoint.

Steps to reproduce

  1. Go to the API docs for an endpoint that takes a {slug} like https://hangar.papermc.io/api-docs#get-/api/v1/projects/-slug-/latestrelease
  2. Enter a project slug into the field like ViaVersion/ViaVersion
  3. Click the "Try" button
  4. See an empy response and Response Status: 404 shown

Other

No response

MiniDigger commented 4 months ago

slugs don't require a slash. we call "ViaVersion/ViaVersion" as namespace, where the first is the owner and the second part is the project slug. so you just want to put "ViaVersion" in there.

I guess we could be better at explaining the term slug, but its already documented for all endpoints that return a project image