
kotlin.nested_class.mustache Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of json-kotlin-schema-codegen Show documentation
Show all versions of json-kotlin-schema-codegen Show documentation
Code generation from JSON Schema to Kotlin or Java
{{#schema}}{{#description}} /**
* {{&safeDescription}}
*/
{{/description}}{{/schema}}{{#isObject}} {{#numberOfProperties}}data class {{&className}}(
{{#properties}}{{#schema}}{{#description}} /** {{&safeDescription}} */
{{/description}}{{/schema}} val {{&kotlinName}}: {{>type}}{{^isRequired}} = {{!
}}{{#defaultValue}}{{>default_value}}{{/defaultValue}}{{^defaultValue}}null{{/defaultValue}}{{/isRequired}}{{^last}},{{/last}}
{{/properties}} ){{#validationsPresent}} {
init {
{{#properties}}{{>validations}}{{/properties}} }
}{{/validationsPresent}}{{/numberOfProperties}}{{^numberOfProperties}}open class {{&className}}{{/numberOfProperties}}{{/isObject}}{{#isString}} enum class {{&className}} {
{{#enumValues}} {{&.}}{{^last}},{{/last}}
{{/enumValues}} }{{/isString}}