mirror of
https://github.com/ReVanced/revanced-api.git
synced 2026-02-01 07:31:03 +00:00
feat: Convert static about file to documented route & add key parameter to about route
This commit is contained in:
@@ -5,6 +5,7 @@ import app.revanced.api.configuration.installCache
|
||||
import app.revanced.api.configuration.installNoCache
|
||||
import app.revanced.api.configuration.installNotarizedRoute
|
||||
import app.revanced.api.configuration.respondOrNotFound
|
||||
import app.revanced.api.configuration.schema.APIAbout
|
||||
import app.revanced.api.configuration.schema.APIContributable
|
||||
import app.revanced.api.configuration.schema.APIMember
|
||||
import app.revanced.api.configuration.schema.APIRateLimit
|
||||
@@ -56,6 +57,16 @@ internal fun Route.apiRoute() {
|
||||
}
|
||||
}
|
||||
|
||||
route("about") {
|
||||
installCache(1.days)
|
||||
|
||||
installAboutRouteDocumentation()
|
||||
|
||||
get {
|
||||
call.respond(apiService.about)
|
||||
}
|
||||
}
|
||||
|
||||
route("ping") {
|
||||
installNoCache()
|
||||
|
||||
@@ -79,6 +90,21 @@ internal fun Route.apiRoute() {
|
||||
}
|
||||
}
|
||||
|
||||
private fun Route.installAboutRouteDocumentation() = installNotarizedRoute {
|
||||
tags = setOf("API")
|
||||
|
||||
get = GetInfo.builder {
|
||||
description("Get information about the API")
|
||||
summary("Get about")
|
||||
response {
|
||||
description("Information about the API")
|
||||
mediaTypes("application/json")
|
||||
responseCode(HttpStatusCode.OK)
|
||||
responseType<APIAbout>()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private fun Route.installRateLimitRouteDocumentation() = installNotarizedRoute {
|
||||
tags = setOf("API")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user