mirror of
https://github.com/MingweiSamuel/Riven.git
synced 2024-12-27 11:26:31 +00:00
Fix handling of names for 'type' arg
This commit is contained in:
parent
5987a6f07f
commit
612ffde26b
2 changed files with 5 additions and 5 deletions
|
@ -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 a new issue