pterodactyl / panel

Pterodactyl® is a free, open-source game server management panel built with PHP, React, and Go. Designed with security in mind, Pterodactyl runs all game servers in isolated Docker containers while exposing a beautiful and intuitive UI to end users.
https://pterodactyl.io
Other
6.58k stars 1.64k forks source link

API Consistency #4572

Open devnote-dev opened 1 year ago

devnote-dev commented 1 year ago

Is there an existing feature request for this?

Describe the feature you would like to see.

Between the application and client API there are many differences for resource responses that don't make sense or are not necessary. The purpose of this issue is to outline the ones found so that they can be changed for v2.

Account resource vs User resource

The client side of the panel uses most of the data provided in the User resource, but the Account resource doesn't provide all of that data. Instead, the missing data is taken from the siteConfiguration object embedded in the HTML. Why? There is no reason I could find for this.

Allocation and Database resource in both APIs

There are minimal differences in these resources, but still worth noting as they can be unified under one controller (for each resource respectively).

Egg resource in the client API

The egg resource in the client API is more or less useless, providing only a name an UUID. Furthermore, it's not even used at all within the client side of the panel, and serves only as an includable resource in the server endpoints in the client API. This should either be populated with more information like in the application API, or removed entirely.

I will update this issue with more if I find any.

Describe the solution you'd like.

Have consistent resource responses for the application and client API, and remove unnecessary abstractions from them (as stated above).

Additional context to this request.

N/A

TheFallenSpirit commented 1 year ago

I think updating the API and making stuff more consistent would be an excellent idea. It would be easier for the developer to understand if the application API and client APIs had consistency in the data they provide. +1