Skip to content

Undefined values are not spec-compatible #9

Description

@gpsfl

Version Information:

  • SF GeoJSON Java Version: 3.3.3

Expected Results:

According to the specification the following fields should be printed as an empty array inside the JSON:

  • features in FeatureCollection
  • coordinates in all geometries
  • geometries in GeometryCollection

Observed Results:

The fields are omitted entirely inside the JSON.

This causes parse errors in other spec-compliant software such as maplibre.

Relevant Code:

    static void main() {
        System.out.println(FeatureConverter.toStringValue(new FeatureCollection()));
    }

Additional Information:

This is caused by @JsonInclude(Include.NON_EMPTY) in the GeoJsonObject class. It should probably be added on the individual fields where it's needed only.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions