From c38afa775310dd4164049a32e27dac586cfb6c0b Mon Sep 17 00:00:00 2001 From: Mingwei Samuel Date: Wed, 30 Jun 2021 14:07:37 -0700 Subject: [PATCH] Fix handling of names for 'type' arg --- srcgen/dotUtils.js | 2 +- srcgen/endpoints.rs.dt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/srcgen/dotUtils.js b/srcgen/dotUtils.js index db7be93..51c0a6c 100644 --- a/srcgen/dotUtils.js +++ b/srcgen/dotUtils.js @@ -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; diff --git a/srcgen/endpoints.rs.dt b/srcgen/endpoints.rs.dt index f5460b5..50233f0 100644 --- a/srcgen/endpoints.rs.dt +++ b/srcgen/endpoints.rs.dt @@ -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 })); } }