title: Many to many mapping JsonMappingException: Infinite recursion (StackOverflowError)
body: <p>I know it is a duplicate question. I have done this type of implementation many times. Not sure why is it not working this time.
  <br/> very standard implementation
  I know it is a duplicate question. I have done this type of implementation many times. Not sure why is it not working this time.
  <br/> very standard implementation</p>
  
  <pre><code>public class Car implements BaseResponse {
  
      @Id
      @SequenceGenerator(name = "car_generator", sequenceName = "car_sequence", allocationSize = 1)
      @GeneratedValue(generator = "car_generator")
      private Long id;
      @NotNull
      private String name;
      @NotNull
      private String description;
  
      @ManyToMany(fetch = FetchType.LAZY, mappedBy="cars")
      private Set&lt;part&gt; parts;
  }
  
  @JsonIgnoreProperties({"cars"})
  public class Part implements BaseResponse {
  
      @Id
      @SequenceGenerator(name = "part_generator", sequenceName = "part_sequence", allocationSize = 1)
      @GeneratedValue(generator = "part_generator")
      private Long id;
  
      private String name;
  
      @ManyToMany(fetch = FetchType.LAZY)
      @JoinTable(
                name = "car_part",
                joinColumns = @JoinColumn(name = "part_id", referencedColumnName = "id"),
                inverseJoinColumns = @JoinColumn(name = "car_id", referencedColumnName = "id"))
      private Set&lt;car&gt; cars;
  }
  
  create table if not exists parts
  (
      id BIGINT,
      name varchar,
      criteria varchar,
      customers_count int,
      primary key(id)
  );
  
  create table if not exists car_part
  (
      car_id bigint,
      part_id bigint
  );
  </code></pre>
  
  <p>The error I keep getting is</p>
  
  <pre><code>Could not write content: Infinite recursion (StackOverflowError) (through reference chain: java.util.ArrayList[0]-&gt;com.saylent.domain.car["parts"]); nested exception is com.fasterxml.jackson.databind.JsonMappingException: Infinite recursion (StackOverflowError) (through reference chain: java.util.ArrayList[0]-&gt;com.saylent.domain.car["parts"])
  </code></pre>