mirror of
https://github.com/MingweiSamuel/Riven.git
synced 2024-12-27 03:16:33 +00:00
31 lines
1 KiB
Text
31 lines
1 KiB
Text
{{
|
|
const spec = require('./.spec.json');
|
|
const dotUtils = require('./dotUtils.js');
|
|
|
|
const operations = [];
|
|
for (const [ route, path ] of Object.entries(spec.paths)) {
|
|
for (const [ method, operation ] of Object.entries(path)) {
|
|
if (method.startsWith('x-')) continue;
|
|
operations.push({ route, method, operation });
|
|
}
|
|
}
|
|
}}{{= dotUtils.preamble() }}
|
|
|
|
// http://www.mingweisamuel.com/riotapi-schema/tool/
|
|
// Version {{= spec.info.version }}
|
|
|
|
//! Metadata about the Riot API and Riven.
|
|
//!
|
|
//! Note: this modules is automatically generated.
|
|
|
|
/// Metadata for endpoints. Each tuple corresponds to one endpoint and contains
|
|
/// the HTTP [`Method`](reqwest::Method), `str` path, and the method's `str` ID.
|
|
pub static ALL_ENDPOINTS: [(reqwest::Method, &str, &str); {{= operations.length }}] = [
|
|
{{
|
|
for (const { route, method, operation } of operations) {
|
|
}}
|
|
(reqwest::Method::{{= method.toUpperCase() }}, "{{= route }}", "{{= operation.operationId }}"),
|
|
{{
|
|
}
|
|
}}
|
|
];
|