@goast/kotlin 0.2.2 → 0.2.4

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.
@@ -147,7 +147,7 @@ class DefaultKotlinOkHttp3Generator extends file_generator_1.KotlinFileGenerator
147
147
  });
148
148
  }),
149
149
  returnType: ctx.refs.apiResponse([
150
- this.getTypeUsage(ctx, { schema: responseSchema, fallback: ast_1.kt.refs.unit(), nullable: true }),
150
+ this.getTypeUsage(ctx, { schema: responseSchema, fallback: ast_1.kt.refs.unit({ nullable: true }), nullable: true }),
151
151
  ]),
152
152
  body: this.getEndpointClientHttpInfoMethodBody(ctx, { endpoint, parameters, responseSchema }),
153
153
  });
@@ -79,9 +79,9 @@ class DefaultKotlinSpringControllerGenerator extends file_generator_1.KotlinFile
79
79
  getApiInterfaceEndpointMethodAnnnotations(ctx, endpoint) {
80
80
  var _a, _b, _c;
81
81
  const operation = ast_1.kt.annotation(ast_1.kt.refs.swagger.operation(), [
82
- ast_1.kt.argument.named('summary', ast_1.kt.string((_a = endpoint.summary) === null || _a === void 0 ? void 0 : _a.trim())),
82
+ endpoint.summary ? ast_1.kt.argument.named('summary', ast_1.kt.string((_a = endpoint.summary) === null || _a === void 0 ? void 0 : _a.trim())) : null,
83
83
  ast_1.kt.argument.named('operationId', ast_1.kt.string(endpoint.name)),
84
- ast_1.kt.argument.named('description', ast_1.kt.string((_b = endpoint.description) === null || _b === void 0 ? void 0 : _b.trim())),
84
+ endpoint.description ? ast_1.kt.argument.named('description', ast_1.kt.string((_b = endpoint.description) === null || _b === void 0 ? void 0 : _b.trim())) : null,
85
85
  ast_1.kt.argument.named('responses', ast_1.kt.collectionLiteral(endpoint.responses.map((response) => {
86
86
  var _a, _b;
87
87
  return ast_1.kt.call(ast_1.kt.refs.swagger.apiResponse(), [
@@ -144,7 +144,7 @@ export class DefaultKotlinOkHttp3Generator extends KotlinFileGenerator {
144
144
  });
145
145
  }),
146
146
  returnType: ctx.refs.apiResponse([
147
- this.getTypeUsage(ctx, { schema: responseSchema, fallback: kt.refs.unit(), nullable: true }),
147
+ this.getTypeUsage(ctx, { schema: responseSchema, fallback: kt.refs.unit({ nullable: true }), nullable: true }),
148
148
  ]),
149
149
  body: this.getEndpointClientHttpInfoMethodBody(ctx, { endpoint, parameters, responseSchema }),
150
150
  });
@@ -76,9 +76,9 @@ export class DefaultKotlinSpringControllerGenerator extends KotlinFileGenerator
76
76
  getApiInterfaceEndpointMethodAnnnotations(ctx, endpoint) {
77
77
  var _a, _b, _c;
78
78
  const operation = kt.annotation(kt.refs.swagger.operation(), [
79
- kt.argument.named('summary', kt.string((_a = endpoint.summary) === null || _a === void 0 ? void 0 : _a.trim())),
79
+ endpoint.summary ? kt.argument.named('summary', kt.string((_a = endpoint.summary) === null || _a === void 0 ? void 0 : _a.trim())) : null,
80
80
  kt.argument.named('operationId', kt.string(endpoint.name)),
81
- kt.argument.named('description', kt.string((_b = endpoint.description) === null || _b === void 0 ? void 0 : _b.trim())),
81
+ endpoint.description ? kt.argument.named('description', kt.string((_b = endpoint.description) === null || _b === void 0 ? void 0 : _b.trim())) : null,
82
82
  kt.argument.named('responses', kt.collectionLiteral(endpoint.responses.map((response) => {
83
83
  var _a, _b;
84
84
  return kt.call(kt.refs.swagger.apiResponse(), [
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@goast/kotlin",
3
- "version": "0.2.2",
3
+ "version": "0.2.4",
4
4
  "repository": "https://github.com/MaSch0212/goast.git",
5
5
  "author": {
6
6
  "name": "Marc Schmidt (MaSch0212)",