forked from mirror/Riven
1
0
Fork 0
Riven/riven/srcgen/meta.rs.dt

30 lines
867 B
Plaintext

{{
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.
pub static ALL_ENDPOINTS: [(reqwest::Method, &str, &str); {{= operations.length }}] = [
{{
for (const { route, method, operation } of operations) {
}}
(reqwest::Method::{{= method.toUpperCase() }}, "{{= route }}", "{{= operation.operationId }}"),
{{
}
}}
];