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

finch.model.mustache Maven / Gradle / Ivy

There is a newer version: 3.0.0-rc1
Show newest version
package {{modelPackage}}

import io.circe._
import io.finch.circe._
import io.circe.generic.semiauto._
import io.circe.java8.time._
import {{packageName}}._
{{#imports}}import {{import}}
{{/imports}}

{{#models}}
{{#model}}
/**
 * {{{description}}}
{{#vars}}
 * @param {{name}} {{{description}}}
{{/vars}}
 */
case class {{classname}}({{#vars}}{{name}}: {{^required}}Option[{{{datatype}}}]{{/required}}{{#required}}{{{datatype}}}{{/required}}{{^-last}},{{/-last}}
                {{/vars}})

object {{classname}} {
    /**
     * Creates the codec for converting {{classname}} from and to JSON.
     */
    implicit val decoder: Decoder[{{classname}}] = deriveDecoder
    implicit val encoder: ObjectEncoder[{{classname}}] = deriveEncoder
}
{{/model}}
{{/models}}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy