diff --git a/generator/src/main/kotlin/sh/christian/ozone/api/generator/builder/util.kt b/generator/src/main/kotlin/sh/christian/ozone/api/generator/builder/util.kt index 55ce7f0..ae259ad 100644 --- a/generator/src/main/kotlin/sh/christian/ozone/api/generator/builder/util.kt +++ b/generator/src/main/kotlin/sh/christian/ozone/api/generator/builder/util.kt @@ -257,6 +257,13 @@ fun createOpenEnumClass( .build() ) + val superToString: FunSpec = + FunSpec.builder("toString") + .addModifiers(KModifier.OVERRIDE) + .returns(STRING) + .addStatement("return super.toString()") + .build() + val valueOfControlFlow = CodeBlock.builder() .beginControlFlow("return when (value)") @@ -270,6 +277,7 @@ fun createOpenEnumClass( .addDescription(entry.description) .superclass(className) .addSuperclassConstructorParameter("%S", entry.name) + .addFunction(superToString) .build() ) }