Fix handling of names for 'type' arg

pull/27/head
Mingwei Samuel 2021-06-30 14:07:37 -07:00
parent c813228603
commit c38afa7753
2 changed files with 2 additions and 2 deletions

View File

@ -102,7 +102,7 @@ function formatJsonProperty(name) {
function formatAddQueryParam(param) {
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 condEnd = param.required ? '' : ' }'
const prop = param.schema;

View File

@ -137,7 +137,7 @@ impl<'a> {{= endpoint }}<'a> {
const required = paramList === pathParams;
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 }));
}
}