title: How can I set the AllowAdditionalProperties to true in generating the schema with NJsonSchema
body: <p>We are now going to use <a href="http://njsonschema.org" rel="nofollow">NJsonSchema</a> to check the Json files for required fields only, and we allow user to add some extra fields for their local use.  So, it has to allow additional properties in the Json file.</p>
  
  <p>By using the NJsonSchma, there has the setting for additionalProperties, but when we gernate the schema using FromType, and then set the option AllowAdditionalProperties, it will apply to the top level only,</p>
  
  <p>For example:</p>
  
  <pre><code>NJsonSchema.JsonSchema4 schema = JsonSchema4.FromType&lt;Top&gt;();
  schema.AllowAdditionalProperties = true;
  
  public class Item
  {
      public string code { get; set; }
      public string name { get; set; }
  }
  
  public class Top
  {
      public List&lt;Item&gt; data { get; set; }
  }
  </code></pre>
  
  <p>Now, it allows additional properties for Top, but not for Item.
  i.e.    </p>
  
  <pre><code>// allowed even ref is not defined in Top
  var js = "{\"data\":[{\"code\":\"A01\",\"name\":\"apple\"}],\"ref\":\"A01\"}";  
  
  // ArrayItemNotValid as price is not defined in Item
  var js = "{\"data\":[{\"code\":\"A01\",\"name\":\"apple\",\"price\":1.0}],\"ref\":\"A01\"}";
  </code></pre>
  
  <p>We even try to build a iteration function to set the value in properties dictionary, but it still cannot change the behavior:</p>
  
  <pre><code>public static void SetAditionalProperties(JsonProperty jp)
  {
      jp.AllowAdditionalProperties = true;
      foreach (KeyValuePair&lt;string, JsonProperty&gt; kv in jp.Properties)
      {
          SetAditionalProperties(kv.Value);
      }
  }
  </code></pre>
  
  <p>The only thing we can do now is to download the source, and change the getter of AllowAdditionalProperties to return true all the time.  Of course we know that this is not a proper way, but we can't find any alternative at this moment, and we'd like to use a proper way later if any.</p>
  
  <p>It seems that this is just a default setting in generating the schema,  but we can't find such option (maybe we have missed), does anyone know how we can change this setting in generating the schema?</p>