templates.kotlin.class_map_property.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
{{&indent}} require(cg_map["{{&name}}"] is {{>type_or_list_or_set}}) { "{{&name}} is not the correct type, expecting {{>type}}" }
{{#isArray}}{{&indent}} (cg_map["{{&name}}"] as {{>list_or_set}}<*>).forEach { {{#indent.increment}}{{#arrayItems}}{{&kotlinName}} ->
{{>class_map_property_item}}{{/arrayItems}}{{/indent.increment}}{{&indent}} }
{{/isArray}}{{^isArray}}{{#validations}}{{#first}}{{&indent}} (cg_map["{{&name}}"] as {{>type}}){{#nullable}}?{{/nullable}}.let { {{&kotlinName}} ->
{{/first}}{{#indent.increment}}{{>validations_2}}{{/indent.increment}}{{#last}}{{&indent}} }
{{/last}}{{/validations}}{{/isArray}}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy