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

scala-lagom-server.model.mustache Maven / Gradle / Ivy

There is a newer version: 7.8.0
Show newest version
{{>licenseInfo}}
package {{package}}
import play.api.libs.json._
{{#imports}}
import {{import}}
{{/imports}}

{{#models}}
{{#model}}
case class {{classname}} (
{{#vars}}
    {{#isEnum}}
                  {{{name}}}:  Option[{{classname}}{{datatypeWithEnum}}.{{classname}}{{datatypeWithEnum}}]{{^-last}},{{/-last}}
    {{/isEnum}}
    {{^isEnum}}
        {{#description}}
            /* {{{.}}} */
        {{/description}}
                  {{{name}}}: {{^required}}Option[{{/required}}{{dataType}}{{^required}}]{{/required}}{{^-last}},{{/-last}}
    {{/isEnum}}
{{/vars}}
)

object {{classname}} {
implicit val format: Format[{{classname}}] = Json.format
}

{{#vars}}
  {{#isEnum}}
object {{classname}}{{datatypeWithEnum}} extends Enumeration {
  val {{#allowableValues}}  {{#values}}{{.}}{{^-last}}, {{/-last}}{{/values}} = Value{{/allowableValues}}
  type {{classname}}{{datatypeWithEnum}} = Value
  implicit val format: Format[Value] = Format(Reads.enumNameReads(this), Writes.enumNameWrites[{{classname}}{{datatypeWithEnum}}.type])
}
 {{/isEnum}}
{{/vars}}
{{/model}}
{{/models}}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy