diff --git a/smartype-generator/src/main/kotlin/com/mparticle/smartype/generator/SmartypeObject.kt b/smartype-generator/src/main/kotlin/com/mparticle/smartype/generator/SmartypeObject.kt index 5ae7fb4..463fe04 100644 --- a/smartype-generator/src/main/kotlin/com/mparticle/smartype/generator/SmartypeObject.kt +++ b/smartype-generator/src/main/kotlin/com/mparticle/smartype/generator/SmartypeObject.kt @@ -37,7 +37,7 @@ class SmartypeObject(options: GeneratorOptions) { } file = FileSpec.builder(packageName(isWeb), libraryName) - .addComment("CODE GENERATED BY SMARTYPE, DO NOT MODIFY.") + .addComment("%S", "CODE GENERATED BY SMARTYPE, DO NOT MODIFY.") file.addImport("com.mparticle.smartype.api", "Message") file.addImport("kotlinx.serialization.json", "JsonElement") file.addImport("kotlinx.serialization.json", "JsonObject") @@ -157,8 +157,8 @@ class SmartypeObject(options: GeneratorOptions) { val schemaDescription: JsonPrimitive? if (definition.containsKey("description")) { schemaDescription = definition["description"] as JsonPrimitive - if (!schemaDescription.content.isBlank()) { - dpClassPoint.addKdoc(schemaDescription.content) + if (schemaDescription.content.isNotBlank()) { + dpClassPoint.addKdoc("%S", schemaDescription.content) } } @@ -449,8 +449,8 @@ class SmartypeObject(options: GeneratorOptions) { propertyBuilder.addModifiers(KModifier.PUBLIC) - if (description != null && !description.isBlank()) { - propertyBuilder.addKdoc(description) + if (!description.isNullOrBlank()) { + propertyBuilder.addKdoc("%S", description) } dpClassPoint.addProperty(