This repository has been archived by the owner on Oct 22, 2023. It is now read-only.
Rewrite the Generate Endpoints script #30
Labels
lib: discatcore
This PR/issue is for DisCatCore.
p: low
priority: low - This PR/issue is not important, can be delayed for a while.
t: refactor
type: refactor - This PR refactors code or this issue proposes to refactor code.
Overview of the Feature Request
Rewrite the generate endpoints script, renaming it to
generate_routes.py
, rename thedata/endpoints
folder todata/routes
, and change the type of the files used indata/routes
from JSON to TOML.What is this Feature Request for?
DisCatCore
The Problem
The generate endpoints script needs a good code scrub. There are some things that could be done better or just completely removed, like the function generator's
generate
method. Also the function generator's methods for managing arguments can be removed in favor of the publicly available list of args. There might be more, and they'll be seen in my PR.Now to the name changes. Since the beginning of the endpoint generator, I thought that the name "endpoint" sounded more appropriate and did not consider the name "route" at all. The name "route" is used for the HTTP client to specify the metadata about a Discord API route. It makes more sense to name our endpoint generate a route generator since the route wrappers generated wrap Discord API routes (obviously).
Finally, the file change. JSON is unreadable for our purposes.. TOML would be a better format, since it's designed to be a config file format and human readable.
The Solution
Here's what a new route file under TOML will look like:
Current Solution
N/A
Additional context
N/A
The text was updated successfully, but these errors were encountered: