@goast/kotlin 0.2.0 → 0.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -200,8 +200,10 @@ class DefaultKotlinOkHttp3Generator extends file_generator_1.KotlinFileGenerator
200
200
  : core_1.builderTemplate.indent `
201
201
  .apply {${core_1.builderTemplate.indent `
202
202
  ${(0, core_1.appendValueGroup)(queryParameters.map((param) => {
203
+ var _a;
203
204
  const paramName = (0, core_1.toCasing)(param.name, ctx.config.parameterNameCasing);
204
- const put = (0, core_1.builderTemplate) `put(${ast_1.kt.string(paramName)}, listOf(${paramName}.toString()))`;
205
+ const toString = ((_a = param.schema) === null || _a === void 0 ? void 0 : _a.kind) === 'array' ? '.joinToString()' : '.toString()';
206
+ const put = (0, core_1.builderTemplate) `put(${ast_1.kt.string(paramName)}, listOf(${paramName}${toString}))`;
205
207
  return param.required
206
208
  ? put
207
209
  : (0, core_1.builderTemplate) `if (${paramName} != null) {${core_1.builderTemplate.indent `
@@ -197,8 +197,10 @@ export class DefaultKotlinOkHttp3Generator extends KotlinFileGenerator {
197
197
  : s.indent `
198
198
  .apply {${s.indent `
199
199
  ${appendValueGroup(queryParameters.map((param) => {
200
+ var _a;
200
201
  const paramName = toCasing(param.name, ctx.config.parameterNameCasing);
201
- const put = s `put(${kt.string(paramName)}, listOf(${paramName}.toString()))`;
202
+ const toString = ((_a = param.schema) === null || _a === void 0 ? void 0 : _a.kind) === 'array' ? '.joinToString()' : '.toString()';
203
+ const put = s `put(${kt.string(paramName)}, listOf(${paramName}${toString}))`;
202
204
  return param.required
203
205
  ? put
204
206
  : s `if (${paramName} != null) {${s.indent `
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@goast/kotlin",
3
- "version": "0.2.0",
3
+ "version": "0.2.1",
4
4
  "repository": "https://github.com/MaSch0212/goast.git",
5
5
  "author": {
6
6
  "name": "Marc Schmidt (MaSch0212)",
@@ -12,7 +12,7 @@
12
12
  "fs-extra": "^11.2.0",
13
13
  "node-fetch": "^2.7.0",
14
14
  "yaml": "^2.4.1",
15
- "@goast/core": "0.2.0",
15
+ "@goast/core": "0.2.1",
16
16
  "tslib": "2.6.2"
17
17
  },
18
18
  "module": "./esm/index.js",