title: Generate avsc avro schema from a scala case class at build
body: <p>I want to generate an avro schema from a scala case class.</p>
  
  <p>Suppose I have the following scala case class : </p>
  
  <p><code>case class User(name : String, favorite_number: Int, favorite_color: String)</code></p>
  
  <p>The related avro schema is :</p>
  
  <pre><code>{"namespace": "example.avro",
   "type": "record",
   "name": "User",
   "fields": [
       {"name": "name", "type": "string"},
       {"name": "favorite_number",  "type": "int"},
       {"name": "favorite_color", "type": "string"}
   ]
  }
  </code></pre>
  
  <p>Is there a way to generate at build time, the avro scehma ? using sbt for example ?
  I saw <a href="https://github.com/sksamuel/sbt-avro4s" rel="nofollow noreferrer">sbt-avro4s</a> that permit to build a scala class from an avro schema, but I need to do the inverse.</p>
  
  <p>Thanks in advance for your help</p>