Riven/srcgen/meta.rs.dt

37 lines
956 B
Plaintext

{{
const spec = require('./.spec.json');
const dotUtils = require('./dotUtils.js');
}}{{= 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.
use std::collections::HashMap;
use lazy_static::lazy_static;
lazy_static! {
pub static ref ENDPOINT_PATH_METHODID: HashMap<&'static str, &'static str> = {
let mut map = HashMap::new();
{{
for (const [ route, path ] of Object.entries(spec.paths)) {
const get = path.get;
if (!get) /* Only support GET parameters. */
continue;
if ((get.parameters || []).some(p => 'header' === p.in)) /* Do not support header parameter methods. */
continue;
const operationId = get.operationId;
}}
map.insert("{{= route }}", "{{= operationId }}");
{{
}
}}
map
};
}