<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: oded</title>
    <description>The latest articles on DEV Community by oded (@odedmiller).</description>
    <link>https://dev.to/odedmiller</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F584211%2F887ecfe5-93a4-45ae-ac71-7a0fa6da0ec1.png</url>
      <title>DEV Community: oded</title>
      <link>https://dev.to/odedmiller</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/odedmiller"/>
    <language>en</language>
    <item>
      <title>how do I turn a JASON schema to a javascript object?</title>
      <dc:creator>oded</dc:creator>
      <pubDate>Mon, 01 Mar 2021 10:39:07 +0000</pubDate>
      <link>https://dev.to/odedmiller/how-do-i-turn-a-jason-schema-to-a-javascript-object-5d27</link>
      <guid>https://dev.to/odedmiller/how-do-i-turn-a-jason-schema-to-a-javascript-object-5d27</guid>
      <description>&lt;p&gt;I need to work with a "complex" object that contains an array of objects that contains an array of objects. &lt;br&gt;
I have a JASON schema that describes this object.&lt;br&gt;
I need to create a javascript object according the this schema.&lt;br&gt;
I do NOT need need to validate data according to this JASON schema. The javascript code populates the array's items and properties by means of direct assignment, such as:&lt;br&gt;
mainObj.series[1].instance[2].mode = "Mode 2";&lt;br&gt;
Following is the JSON schema of the object:&lt;br&gt;
{ "$schema": "&lt;a href="http://json-schema.org/draft-07/schema#"&gt;http://json-schema.org/draft-07/schema#&lt;/a&gt;",&lt;br&gt;
  "title": "My-Special-Schema-Or-Data-Structure-Title",&lt;br&gt;
  "description": "Whatever I have to say about my described structure",&lt;br&gt;
  "type": "object",&lt;br&gt;
  "properties": {&lt;br&gt;
    "version": {&lt;br&gt;
      "description": " ... ",&lt;br&gt;
      "type": "string"&lt;br&gt;
    },&lt;br&gt;
    "series": {&lt;br&gt;
      "description": " ... ",&lt;br&gt;
      "type": "array",&lt;br&gt;
      "minItems": 1,&lt;br&gt;
      "items": {&lt;br&gt;
        "description": " ... ",&lt;br&gt;
        "type": "object",&lt;br&gt;
        "properties": {&lt;br&gt;
          "name": {&lt;br&gt;
            "type": "string"&lt;br&gt;
          },&lt;br&gt;
          "possModes": {&lt;br&gt;
            "description": " ... ",&lt;br&gt;
            "type": "array"&lt;br&gt;
          },&lt;br&gt;
          "instance": {&lt;br&gt;
            "description": " ... ",&lt;br&gt;
            "type": "array",&lt;br&gt;
            "minItems": 1,&lt;br&gt;
            "items": {&lt;br&gt;
              "description": " ... ",&lt;br&gt;
              "type": "object",&lt;br&gt;
              "properties": {&lt;br&gt;
                "date": {&lt;br&gt;
                  "type": "string"&lt;br&gt;
                },&lt;br&gt;
                "mode": {&lt;br&gt;
                  "type": "string"&lt;br&gt;
                }&lt;br&gt;
              },&lt;br&gt;
              "required": [&lt;br&gt;
                "date",&lt;br&gt;
                "mode"&lt;br&gt;
              ]&lt;br&gt;
            }&lt;br&gt;
          }&lt;br&gt;
        },&lt;br&gt;
        "required": [&lt;br&gt;
          "name",&lt;br&gt;
          "possModes",&lt;br&gt;
          "instance"&lt;br&gt;
        ]&lt;br&gt;
      }&lt;br&gt;
    }&lt;br&gt;
  },&lt;br&gt;
  "required": [&lt;br&gt;
    "version",&lt;br&gt;
    "series"&lt;br&gt;
  ]&lt;br&gt;
}&lt;/p&gt;

</description>
    </item>
  </channel>
</rss>
