All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.vrap.codegen.languages.go.GoExtensions.kt Maven / Gradle / Ivy

Go to download

RAML API client code generators based on the REST Modeling Framework. https://github.com/vrapio/rest-modeling-framework

The newest version!
package io.vrap.codegen.languages.go

import io.vrap.rmf.codegen.types.*
import io.vrap.rmf.raml.model.types.*
import io.vrap.rmf.raml.model.types.DescriptionFacet
import java.util.*

fun DescriptionFacet.toBlockComment(): String {
    val description = this.description
    return if (description?.value.isNullOrBlank()) {
        ""
    } else description.value
        .lines()
        .joinToString(prefix = "/**\n*\t", postfix = "\n*/", separator = "\n*\t")
}

fun DescriptionFacet.toLineComment(): String {
    val description = this.description
    return if (description?.value.isNullOrBlank()) {
        ""
    } else description.value
        .lines()
        .joinToString(separator = "\n")
        .trimMargin()
        .prependIndent("// ")
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy