mirror of https://github.com/MingweiSamuel/Riven
Fix handling of names for 'type' arg
parent
c813228603
commit
c38afa7753
|
@ -102,7 +102,7 @@ function formatJsonProperty(name) {
|
||||||
|
|
||||||
function formatAddQueryParam(param) {
|
function formatAddQueryParam(param) {
|
||||||
const k = `"${param.name}"`;
|
const k = `"${param.name}"`;
|
||||||
const name = changeCase.snakeCase(param.name);
|
const name = normalizePropName(param.name);
|
||||||
const condStart = param.required ? '' : `mut request = request; if let Some(${name}) = ${name} { `;
|
const condStart = param.required ? '' : `mut request = request; if let Some(${name}) = ${name} { `;
|
||||||
const condEnd = param.required ? '' : ' }'
|
const condEnd = param.required ? '' : ' }'
|
||||||
const prop = param.schema;
|
const prop = param.schema;
|
||||||
|
|
|
@ -137,7 +137,7 @@ impl<'a> {{= endpoint }}<'a> {
|
||||||
const required = paramList === pathParams;
|
const required = paramList === pathParams;
|
||||||
for (const param of paramList)
|
for (const param of paramList)
|
||||||
{
|
{
|
||||||
argBuilder.push(', ', dotUtils.changeCase.snakeCase(param.name), ': ',
|
argBuilder.push(', ', dotUtils.normalizePropName(param.name), ': ',
|
||||||
dotUtils.stringifyType(param.schema, { endpoint, optional: !(required || param.required), owned: false }));
|
dotUtils.stringifyType(param.schema, { endpoint, optional: !(required || param.required), owned: false }));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue