@goast/kotlin 0.0.5 → 0.0.7
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.
|
@@ -107,7 +107,7 @@ class DefaultKotlinModelGenerator extends file_generator_1.KotlinFileGenerator {
|
|
|
107
107
|
if (schema.discriminator) {
|
|
108
108
|
builder.appendAnnotation('JsonTypeInfo', 'com.fasterxml.jackson.annotation', [
|
|
109
109
|
['use', 'JsonTypeInfo.Id.NAME'],
|
|
110
|
-
['include', 'JsonTypeInfo.As.
|
|
110
|
+
['include', 'JsonTypeInfo.As.EXISTING_PROPERTY'],
|
|
111
111
|
['property', this.toStringLiteral(ctx, schema.discriminator.propertyName)],
|
|
112
112
|
['visible', 'true'],
|
|
113
113
|
]);
|
|
@@ -135,7 +135,7 @@ class DefaultKotlinModelGenerator extends file_generator_1.KotlinFileGenerator {
|
|
|
135
135
|
.applyIf(!schema.required.has(property.name), (builder) => builder.appendIf(!property.schema.nullable, '?').append(' = null')));
|
|
136
136
|
}
|
|
137
137
|
generateObjectDataClass(ctx, builder, schema) {
|
|
138
|
-
const inheritedSchemas = schema.inheritedSchemas.filter((x) => this.shouldGenerateTypeDeclaration(ctx, x) && !x.isNameGenerated);
|
|
138
|
+
const inheritedSchemas = schema.inheritedSchemas.filter((x) => this.shouldGenerateTypeDeclaration(ctx, x) && !x.isNameGenerated).filter((item, index, self) => self.indexOf(item) === index);
|
|
139
139
|
builder
|
|
140
140
|
.apply((builder) => this.generateDocumentation(ctx, builder, schema))
|
|
141
141
|
.append('data class ')
|
|
@@ -104,7 +104,7 @@ export class DefaultKotlinModelGenerator extends KotlinFileGenerator {
|
|
|
104
104
|
if (schema.discriminator) {
|
|
105
105
|
builder.appendAnnotation('JsonTypeInfo', 'com.fasterxml.jackson.annotation', [
|
|
106
106
|
['use', 'JsonTypeInfo.Id.NAME'],
|
|
107
|
-
['include', 'JsonTypeInfo.As.
|
|
107
|
+
['include', 'JsonTypeInfo.As.EXISTING_PROPERTY'],
|
|
108
108
|
['property', this.toStringLiteral(ctx, schema.discriminator.propertyName)],
|
|
109
109
|
['visible', 'true'],
|
|
110
110
|
]);
|
|
@@ -132,7 +132,7 @@ export class DefaultKotlinModelGenerator extends KotlinFileGenerator {
|
|
|
132
132
|
.applyIf(!schema.required.has(property.name), (builder) => builder.appendIf(!property.schema.nullable, '?').append(' = null')));
|
|
133
133
|
}
|
|
134
134
|
generateObjectDataClass(ctx, builder, schema) {
|
|
135
|
-
const inheritedSchemas = schema.inheritedSchemas.filter((x) => this.shouldGenerateTypeDeclaration(ctx, x) && !x.isNameGenerated);
|
|
135
|
+
const inheritedSchemas = schema.inheritedSchemas.filter((x) => this.shouldGenerateTypeDeclaration(ctx, x) && !x.isNameGenerated).filter((item, index, self) => self.indexOf(item) === index);
|
|
136
136
|
builder
|
|
137
137
|
.apply((builder) => this.generateDocumentation(ctx, builder, schema))
|
|
138
138
|
.append('data class ')
|