Fix handling of names for 'type' arg

This commit is contained in:
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 }));
}
}