← All projects
Project record1 mention
Originally shared on Hacker News

AWS Step Functions JSON Schema test validator

A proposed tool for testing AWS Step Functions that type checks the evaluated JSONPath payload and the mocked JSON response against global contracts/types written in JSON Schema. It would work by dynamically creating lambdas that act as mocked integration services, validating that the event from Step Functions matches a schema and that the mocked response also matches a schema. Currently only an idea under exploration, with the author's use case centered on calling out to lambdas.

Last shared For Test AWS Step Functions workflows by type checking evaluated JSONPath payloads and mocked JSON responses against global JSON Schema contracts, using dynamically created lambdas that validate both the SFN event and the mocked response against a schema.
01 / The problem

What it addresses

Existing options for testing Step Functions only allow mocking the entire response for every state in JSON or calling out to a lambda, with no way to ensure tests adhere to global contracts/types written in JSON Schema, and the author could not find prior projects doing this.

02 / Source history

Shared over time

Each entry reflects what was shared on that date. Details may have changed since then.

  1. AWS Step Functions JSON Schema test validator

    A proposed tool for testing AWS Step Functions that type checks the evaluated JSONPath payload and the mocked JSON response against global contracts/types written in JSON Schema. It would work by dynamically creating lambdas that act as mocked integration services, validating that the event from Step Functions matches a schema and that the mocked response also matches a schema. Currently only an idea under exploration, with the author's use case centered on calling out to lambdas.

    Problem: Existing options for testing Step Functions only allow mocking the entire response for every state in JSON or calling out to a lambda, with no way to ensure tests adhere to global contracts/types written in JSON Schema, and the author could not find prior projects doing this.

    Audience: Test AWS Step Functions workflows by type checking evaluated JSONPath payloads and mocked JSON responses against global JSON Schema contracts, using dynamically created lambdas that validate both the SFN event and the mocked response against a schema.

    Posted by @jansommer · Original source ↗

    Source text · @jansommer · · Source ↗

    I'm thinking about how to properly test AWS Step Functions. The problem is that I can either mock the entire response for every state in JSON only, or call out to a lambda. What I want is to type check the evaluated JSONPath payload and the mocked JSON response, to ensure that my tests always adheres to global contracts/types written in JSON Schema.