@goast/kotlin 0.1.4 → 0.1.5

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.
@@ -190,7 +190,15 @@ class DefaultKotlinModelGenerator extends file_generator_1.KotlinFileGenerator {
190
190
  builder.append(String(schema.default));
191
191
  break;
192
192
  case 'string':
193
- builder.append(this.toStringLiteral(ctx, String(schema.default)));
193
+ if (schema.enum && schema.enum.length > 0) {
194
+ builder
195
+ .append((builder) => this.generateTypeUsage(ctx, builder, schema))
196
+ .append('.')
197
+ .append((0, core_1.toCasing)(String(schema.default), ctx.config.enumValueNameCasing));
198
+ }
199
+ else {
200
+ builder.append(this.toStringLiteral(ctx, String(schema.default)));
201
+ }
194
202
  break;
195
203
  default:
196
204
  builder.append('null');
@@ -187,7 +187,15 @@ export class DefaultKotlinModelGenerator extends KotlinFileGenerator {
187
187
  builder.append(String(schema.default));
188
188
  break;
189
189
  case 'string':
190
- builder.append(this.toStringLiteral(ctx, String(schema.default)));
190
+ if (schema.enum && schema.enum.length > 0) {
191
+ builder
192
+ .append((builder) => this.generateTypeUsage(ctx, builder, schema))
193
+ .append('.')
194
+ .append(toCasing(String(schema.default), ctx.config.enumValueNameCasing));
195
+ }
196
+ else {
197
+ builder.append(this.toStringLiteral(ctx, String(schema.default)));
198
+ }
191
199
  break;
192
200
  default:
193
201
  builder.append('null');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@goast/kotlin",
3
- "version": "0.1.4",
3
+ "version": "0.1.5",
4
4
  "repository": "https://github.com/MaSch0212/goast.git",
5
5
  "author": {
6
6
  "name": "Marc Schmidt (MaSch0212)",