Skip to content

Feature: Advanced parser utility #147

Closed
@heitorlessa

Description

@heitorlessa

Is your feature request related to a problem? Please describe.

We've heard from a small number of customers that parsing Lambda Event Source payloads require a considerable effort since these don't have official schemas for Python.

With parsing and classes modelled after these schemas, they can have the benefits of runtime type safety, custom validations on possible values pertinent to their use case, autocomplete, and only parse fields they're interested in.

Describe the solution you'd like

Solution is two-fold:

  • A new parser utility that uses Pydantic to parse and validate incoming/outgoing events, and allow customers to use their own data models
  • Pre-defined schemas and event envelopes for popular event sources, so one can apply and validate their models against where they payload is

This would reduce the amount of time developers invest searching for official data structure for each event source, improve their security posture on incoming and outgoing events, and increased developer productivity.

Describe alternatives you've considered

  • Implement simple validation using JSON Schemas as well as an extractor utility to retrieve the payload only
  • Bring Pydantic as an optional package to prevent bloating the library for those not using it

Challenge with JSON Schemas is they typically don't validate business rules for incoming/outgoing events, but merely a schema.

Additional context

Initial implementation that lacked customer data points as of now, but could be revisited depending on interest for thisfeature: #118

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    Status

    Triage

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions