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

Use Ktor resources instead of own Route objects #589

Open
DRSchlaubi opened this issue Apr 10, 2022 · 0 comments
Open

Use Ktor resources instead of own Route objects #589

DRSchlaubi opened this issue Apr 10, 2022 · 0 comments
Assignees
Labels
enhancement New feature or request

Comments

@DRSchlaubi
Copy link
Member

DRSchlaubi commented Apr 10, 2022

Summary

With the release of Ktor 2.0.0 the old location API was replaced by the new resource API which comes with a lot of advantages. The two most important being

  • It uses Kotlinx.serialization, so now we can add parameters with _ in them without violating Kotlin naming conventions (as now there is @SerialName
  • It is now also available to the client and MPP

Consideration

Currently, kord-rest is not entirely dependent on Ktor, you should be able to write your own RequestHandler, which does not use Ktor, however realistically no one is going to do that anyway, and you need to use Ktor for all other parts of Kord already

Challenges

Rate limiting

The existing Route objects are also used for rate limiting, and I am currently not sure whether we can still store all of the rate limiting information

Serialization

Until now, Routes also stored the request method and the body type, this might need to change

@DRSchlaubi DRSchlaubi added the enhancement New feature or request label Apr 10, 2022
@DRSchlaubi DRSchlaubi self-assigned this Apr 10, 2022
@DRSchlaubi DRSchlaubi added on hold Something is preventing this issue from being resolved and removed on hold Something is preventing this issue from being resolved labels Apr 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant