Skip to content

Add support for extending zod error messages from existing objects #6758

Open

Description

@anthonyyya

I have a zod object that is handed to me from elsewhere, and I do not have the ability to change it. However, I do know what items it contains. For example, it has a "firstName" string with a min length of 3 and a max length of 24.

I believe at present there is no way to do something like:

import { alreadyMadeSchema } from 'external-schema-provider';

...

const updatedSchema = alreadyMadeSchema.update({
firstName.min.3: "too short",
firstName.max.24: "too long"
});

Could support be added for such a feature? I had requested this in #4057 and the ticket was closed without providing the support. Multiple people upvoted my issue, so I believe it is something many people desire.

Activity

  1. anthonyyya commented on Nov 15, 2026

    @anthonyyya
    Author
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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