mirror of https://github.com/MingweiSamuel/Riven
Fix handling of names for 'type' arg
parent
5987a6f07f
commit
612ffde26b
|
@ -127,10 +127,10 @@ function formatQueryParamStringify(name, prop, useOwned = false) {
|
|||
}
|
||||
|
||||
function formatAddQueryParam(param) {
|
||||
let k = `"${param.name}"`;
|
||||
let name = changeCase.snakeCase(param.name);
|
||||
let nc = param.required ? '' : `if let Some(${name}) = ${name} `;
|
||||
let prop = param.schema;
|
||||
const k = `"${param.name}"`;
|
||||
const name = normalizePropName(param.name);
|
||||
const nc = param.required ? '' : `if let Some(${name}) = ${name} `;
|
||||
const prop = param.schema;
|
||||
switch (prop.type) {
|
||||
case 'array': return `${nc}{ query_params.extend_pairs(${name}.iter()`
|
||||
+ `.map(|w| (${k}, ${formatQueryParamStringify("w", prop.items, true)}))); }`;
|
||||
|
|
|
@ -108,7 +108,7 @@ impl<'a> {{= endpoint }}<'a> {
|
|||
let required = paramList === pathParams;
|
||||
for (let param of paramList)
|
||||
{
|
||||
argBuilder.push(', ', dotUtils.changeCase.snakeCase(param.name), ': ',
|
||||
argBuilder.push(', ', dotUtils.normalizePropName(param.name), ': ',
|
||||
dotUtils.stringifyType(param.schema, { endpoint, optional: !required, owned: false }));
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue