Skip to content

Feature.Id only supports String type #187

@dmitry-kandiner

Description

@dmitry-kandiner

Hello!

According to https://datatracker.ietf.org/doc/html/rfc7946#section-3.2, the Id field of the Feature, if present, can be either number or string:

If a Feature has a commonly used identifier, that identifier
SHOULD be included as a member of the Feature object with the name
"id", and the value of this member is either a JSON string or
number.

However, current implementation only supports deserialization of string values for this field.
Proposed solutions:

  • A custom JSON converter for this field, with storing the value as a string.
  • Storing the value as a discriminated union of string and int (or long).

Best regards,
Dmitry

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions