From bb3d3f5017e06587c7f809cb631b64501990a92f Mon Sep 17 00:00:00 2001 From: Ivan Ponomarev Date: Mon, 28 Aug 2023 17:45:55 +0300 Subject: [PATCH] * don't use data object (#232) * update version --- pom.xml | 2 +- src/main/java/ru/curs/hurdygurdy/KotlinTypeDefiner.kt | 2 +- .../curs/hurdygurdy/KCodegenTest.deepInheritance.approved.txt | 2 +- .../curs/hurdygurdy/KCodegenTest.generateSample3.approved.txt | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/pom.xml b/pom.xml index a0deaa1..2db1736 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ 4.0.0 ru.curs hurdy-gurdy - 1.29 + 1.30 maven-plugin OpenAPI codegen Maven Plugin diff --git a/src/main/java/ru/curs/hurdygurdy/KotlinTypeDefiner.kt b/src/main/java/ru/curs/hurdygurdy/KotlinTypeDefiner.kt index 83b08ac..4651e74 100644 --- a/src/main/java/ru/curs/hurdygurdy/KotlinTypeDefiner.kt +++ b/src/main/java/ru/curs/hurdygurdy/KotlinTypeDefiner.kt @@ -171,7 +171,7 @@ class KotlinTypeDefiner internal constructor( schema.oneOf.isNullOrEmpty() && !isParent ) - TypeSpec.objectBuilder(name).superclass(baseClass).addModifiers(KModifier.DATA) + TypeSpec.objectBuilder(name).superclass(baseClass) else if (!schema.oneOf.isNullOrEmpty()) TypeSpec.interfaceBuilder(name) else diff --git a/src/test/java/ru/curs/hurdygurdy/KCodegenTest.deepInheritance.approved.txt b/src/test/java/ru/curs/hurdygurdy/KCodegenTest.deepInheritance.approved.txt index 5c6d6c4..20324fc 100644 --- a/src/test/java/ru/curs/hurdygurdy/KCodegenTest.deepInheritance.approved.txt +++ b/src/test/java/ru/curs/hurdygurdy/KCodegenTest.deepInheritance.approved.txt @@ -43,4 +43,4 @@ import com.fasterxml.jackson.databind.PropertyNamingStrategies import com.fasterxml.jackson.databind.`annotation`.JsonNaming @JsonNaming(value = PropertyNamingStrategies.SnakeCaseStrategy::class) -public data object C : B() +public object C : B() diff --git a/src/test/java/ru/curs/hurdygurdy/KCodegenTest.generateSample3.approved.txt b/src/test/java/ru/curs/hurdygurdy/KCodegenTest.generateSample3.approved.txt index 89286ae..95ac87d 100644 --- a/src/test/java/ru/curs/hurdygurdy/KCodegenTest.generateSample3.approved.txt +++ b/src/test/java/ru/curs/hurdygurdy/KCodegenTest.generateSample3.approved.txt @@ -69,7 +69,7 @@ import com.fasterxml.jackson.databind.PropertyNamingStrategies import com.fasterxml.jackson.databind.`annotation`.JsonNaming @JsonNaming(value = PropertyNamingStrategies.SnakeCaseStrategy::class) -public data object ClassWithNoFields +public object ClassWithNoFields --- /com/example/dto/CreateUpdateUserRequest.kt package com.example.dto