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

Change with the API endpoint for the latest version of a specific channel with a project #1175

Open
thecmdradama opened this issue Apr 23, 2023 · 3 comments

Comments

@thecmdradama
Copy link

thecmdradama commented Apr 23, 2023

Is your feature request related to a problem?

Hi guys,

This feature request is to adjust the API endpoint for project channels.

Lets use ProtocolLib for our example.
The current request URL to get the latest version number of a project in a specific channel is:
https://hangar.papermc.io/api/v1/projects/dmulloy2/ProtocolLib/latest?channel=RC

Describe the solution you'd like.

What I would like to propose instead is to have the channel as a URL slug instead of a URL variable

The proposed request URL for ProtocolLib would look like: https://hangar.papermc.io/api/v1/projects/dmulloy2/ProtocolLib/channels/RC/latest

This would also open up the opportunity to get the full details of a specific version from a specific channel or download the fil i.e.

https://hangar.papermc.io/api/v1/projects/dmulloy2/ProtocolLib/channels/RC/versions/{name}
https://hangar.papermc.io/api/v1/projects/dmulloy2/ProtocolLib/channels/RC/versions/{name}/download

Describe alternatives you've considered.

I can't think of any other clean way to do this so there isn't really any alternative

Other

No response

@kennytv
Copy link
Member

kennytv commented May 8, 2023

Versions exist indepentendly of channels, so the last two examples you provide don't make much sense - Is there any other reason you want the channel not to be a query parameter?

@thecmdradama
Copy link
Author

thecmdradama commented May 9, 2023

I guess the main purpose was to try and improve the readability of the URI by replacing the query parameter with a slug. Now I look at them more, those two examples don't make a great deal of sense in comparison to the existing version endpoints. The theory was to drill down from the channel to get the latest version, which now I see would have been backwards.

Something like these would make more sense
https://hangar.papermc.io/api/v1/projects/{author}/{slug}/versions/latest/channel/{name}/{platform}/download
https://hangar.papermc.io/api/v1/projects/{author}/{slug}/versions/latest/channel/{name}/stats

@MiniDigger
Copy link
Member

what is the actual usecase you want to have? just adding new endpoints just because the urls look nicer doesnt make much sense to me

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: New
Development

No branches or pull requests

3 participants