Generate javascript class/objects from a YAML
<p>Is there any tool to generate JavaScript classes from a YAML ?</p>

<p>I have a swagger YAML and I want to generate javascript models that look like this : </p>

<pre><code>'use strict';

function Product(name,description){
    this.name = name;
    this.description = description;
    this.toString = function(){
        return this.name+" : "+this.description;
}
</code></pre>

<p>}</p>

<p>using the swagger YAML :</p>

<pre><code>.
.
.
definitions:
  product:
properties:
  name:
    type: string
  description:
    type: string
required:
  - name
  - description
.
.
.
</code></pre>