Skip to content

Schema Lenience #756

@dgoetsch

Description

@dgoetsch

Is your feature request related to a problem? Please describe.
In production, many chargers will include extra fields or omit required fields. This is generally a bug on the charger, and building the server to be flexible (especially of additional fields) is important for maintaining operations.

Describe the solution you'd like

  1. parsing is lenient of extra fields, parsing succeeds if additional fields are present
  2. additional fields are extracted from the raw payload and stored in a map on the dataclass
  3. missing fields are also supported via some defaulting mechanism. I don't want to change all the models to have optional fields, that seems like an anti pattern.

Describe alternatives you've considered
We've tried rolling with it as is, and filtering out extra fields in memory before parsing. This kind of thing can be handled on the user side, but library support is better.

Additional context
This is mostly about supporting a wide variety of chargers so that we can handle data that isn't fully spec compliant, but is still processable

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions