title: Json schema to Pojo generator in Java using library jsonschema2pojo-core
body: <p>I am trying to convert json schema to pojo using library jsonschema2pojo-core version 1.0.2 but I am getting error &quot;trying to create the same field twice: additionalProperties&quot;. I am also attaching the code that I am using with Library. Can you guys let me know what I doing wrong here.</p>
  <pre><code>class JsonToPojo {
  
  
      public static void main(String[] args) throws IOException {
          JCodeModel codeModel = new JCodeModel();
          URL source = JsonToPojo.class.getResource(&quot;/test.json&quot;);
          GenerationConfig config = new DefaultGenerationConfig() {
              @Override
              public boolean isGenerateBuilders() { // set config option by overriding method
                  return true;
              }
              @Override
              public SourceType getSourceType() {
                  return SourceType.JSON;
              }
          };
          SchemaMapper mapper = new SchemaMapper(
                  new RuleFactory(config, new Jackson2Annotator(config), new SchemaStore()), new SchemaGenerator());
          mapper.generate(codeModel, &quot;JsonToPojo&quot;, &quot;com.controller&quot;, source);
          File file = Files.createTempDirectory(&quot;required&quot;).toFile();
          codeModel.build(file);
          System.out.println(&quot;path is &quot; + file);
      }
  
  </code></pre>
  <p>Json -</p>
  <pre><code>{
    &quot;$id&quot;: &quot;https://example.com/person.schema.json&quot;,
    &quot;$schema&quot;: &quot;https://json-schema.org/draft/2020-12/schema&quot;,
    &quot;title&quot;: &quot;Person&quot;,
    &quot;type&quot;: &quot;object&quot;,
    &quot;properties&quot;: {
      &quot;firstName&quot;: {
        &quot;type&quot;: &quot;string&quot;,
        &quot;description&quot;: &quot;The person's first name.&quot;
      },
      &quot;lastName&quot;: {
        &quot;type&quot;: &quot;string&quot;,
        &quot;description&quot;: &quot;The person's last name.&quot;
      },
      &quot;age&quot;: {
        &quot;description&quot;: &quot;Age in years which must be equal to or greater than zero.&quot;,
        &quot;type&quot;: &quot;integer&quot;,
        &quot;minimum&quot;: 0
      }
    }
  }
  </code></pre>
  <p>Expected Pojo-</p>
  <pre><code>*/
  @JsonInclude(JsonInclude.Include.NON_NULL)
  @JsonPropertyOrder({
  &quot;firstName&quot;,
  &quot;lastName&quot;,
  &quot;age&quot;
  })
  @Generated(&quot;jsonschema2pojo&quot;)
  public class Example {
  
  /**
  * The person's first name.
  *
  */
  @JsonProperty(&quot;firstName&quot;)
  @JsonPropertyDescription(&quot;The person's first name.&quot;)
  private String firstName;
  /**
  * The person's last name.
  *
  */
  @JsonProperty(&quot;lastName&quot;)
  @JsonPropertyDescription(&quot;The person's last name.&quot;)
  private String lastName;
  /**
  * Age in years which must be equal to or greater than zero.
  *
  */
  @JsonProperty(&quot;age&quot;)
  @JsonPropertyDescription(&quot;Age in years which must be equal to or greater than zero.&quot;)
  private Integer age;
  @JsonIgnore
  private Map&lt;String, Object&gt; additionalProperties = new HashMap&lt;String, Object&gt;();
  
  /**
  * The person's first name.
  *
  */
  @JsonProperty(&quot;firstName&quot;)
  public String getFirstName() {
  return firstName;
  }
  
  /**
  * The person's first name.
  *
  */
  @JsonProperty(&quot;firstName&quot;)
  public void setFirstName(String firstName) {
  this.firstName = firstName;
  }
  
  /**
  * The person's last name.
  *
  */
  @JsonProperty(&quot;lastName&quot;)
  public String getLastName() {
  return lastName;
  }
  
  /**
  * The person's last name.
  *
  */
  @JsonProperty(&quot;lastName&quot;)
  public void setLastName(String lastName) {
  this.lastName = lastName;
  }
  
  /**
  * Age in years which must be equal to or greater than zero.
  *
  */
  @JsonProperty(&quot;age&quot;)
  public Integer getAge() {
  return age;
  }
  
  /**
  * Age in years which must be equal to or greater than zero.
  *
  */
  @JsonProperty(&quot;age&quot;)
  public void setAge(Integer age) {
  this.age = age;
  }
  
  @JsonAnyGetter
  public Map&lt;String, Object&gt; getAdditionalProperties() {
  return this.additionalProperties;
  }
  
  @JsonAnySetter
  public void setAdditionalProperty(String name, Object value) {
  this.additionalProperties.put(name, value);
  }
  
  </code></pre>