title: How can I validate GeoJSON object before saving it into Elasticsearch?
body: <p>My goal is to validate imported JSON file. I am importing a big JSON file using Spring Batch and trying to validate it in ItemProcessor. Problem is that validator is telling me that Geometry is valid and then when I try to save it in Elasticsearch I get the exception.</p>
  <pre><code>Geometry geometry = parser.parse(contentParser);
  GeographyValidator validator = new GeographyValidator(true);
  validator.validate(geometry);
  StandardValidator validator1 = new StandardValidator(true);
  validator1.validate(geometry);
  </code></pre>
  <p>Tried these two validators and both showed that geometry is valid.</p>
  <p>And I also tried this:</p>
  <pre><code>GeoShapeUtils.toLuceneGeometry(item.getProperties().getName(), null, geometry, ShapeRelation.INTERSECTS);
  </code></pre>
  <p>which sometimes throws expected error and sometimes doesn't.</p>
  <p>Elasticshearch version is: 7.17.5 and spring-data-elasticsearch:4.3.3</p>