ynamic&gt; toMap() {
  final map = &lt;String, dynamic&gt;{
    &#39;name&#39;: name,
    &#39;type&#39;: type,
    &#39;description&#39;: description,
    &#39;required&#39;: required,
  };

  if (enumValues != null) map[&#39;enum&#39;] = enumValues;
  if (properties != null) {
    map[&#39;properties&#39;] = properties!.map((k, v) =&gt; MapEntry(k, v.toMap()));
  }
  if (items != null) map[&#39;items&#39;] = items!.toMap();

  return map;
}</code></pre>
</section>


  </div> <!-- /.main-content -->
  <div