Skip to content

Configuration utility #5

Closed
Closed

Description

@mwarman

Describe the story

Create a validation utility which uses the zod library to parse and validate a Zod schema. When validation errors occur, format the ZodError issues into a nicely formatted ValidationError.

Acceptance criteria

GIVEN an object is validated with the validation utility
WHEN the validation succeeds
THEN the parsed and validated object is returned

WHEN the validation fails
THEN a ValidationError is returned whose message contains the issues from the original ZodError

Additional context

Add any other context about the story here.

Activity

  1. added this to the v0.3.0 milestone on Dec 18, 2025
  2. self-assigned this
    on Dec 19, 2025
  3. mwarman commented on Dec 20, 2025

    @mwarman
    MemberAuthor

    After researching a plain "validation" utility, I determined that Zod already makes schema validation so simple that there is no value added by creating a validation utility for Zod.

    However, there is some value to be gained by creating a Lambda configuration validation utility. The configuration utility will:

    • Validate environment variables with a zod schema sourced from process.env
    • Cache a singleton of the parsed, transformed, and validated configuration object.
    • Provide a "getter" to fetch the config object
    • Provide a "refresh" helper function to revalidate and recreate the singleton config object which is useful for testing of different configuration variable values
  4. linked a pull request that will close this issue5 Configuration utility #10on Dec 20, 2025
  5. changed the title [-]Validation utility[/-] [+]Configuration utility[/+] on Dec 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

enhancementNew feature or requestrefineIssue needs refinement

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions