Skip to content

Commit

Permalink
Change null-handling strategy for Java example
Browse files Browse the repository at this point in the history
This satisfies the GeoJSON JSON Schema's requirement that the geometry
key be present, even when there is no value.

I'm not sure how best to handle filtering null extension keys.

A follow-on patch will regenerate the dotnet output.

Signed-off-by: Alex Nelson <[email protected]>
  • Loading branch information
ajnelson-nist committed Aug 27, 2024
1 parent 4591b0b commit 566b137
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ public String run() {
List<GeoRecord> records = resultToObjects(result);

// Convert the list of GeoRecord objects to a GeoJSON string and return the string
Gson gson = new GsonBuilder().setPrettyPrinting().create();
Gson gson = new GsonBuilder().serializeNulls().setPrettyPrinting().create();
Root geoJSON = recordsToGeoJSON(records);
return gson.toJson(geoJSON);
} catch (IOException e) {
Expand Down

0 comments on commit 566b137

Please sign in to comment.