Skip to content

feat: expose JSON schemas for all inputs/outputs #6691

Closed

Description

@capaj

Describe the feature you'd like to request

zod 4 just came with z.toJSONSchema() which allows us to easily convert any zod to a json schema.

it would be awesome if we could get this json for any input/output for every query/mutation
that way we could use this to build forms super easy with libraries like https://github.com/rjsf-team/react-jsonschema-form

Describe the solution you'd like to see

could be a single endpoint or maybe when you call a trpc endpoint with a query param like ?jsonSchema=input
it would return the json schema

Describe alternate solutions

I don't mind any other suggestions

Additional information

No response

👨‍👧‍👦 Contributing

  • 🙋‍♂️ Yes, I'd be down to file a PR implementing this feature!

Activity

  1. KATT commented on Apr 11, 2025

    @KATT
    Member

    See #6696

    Think it's already possible, but it uses internal methods. Could you try it out? Just // @ts-expect-error any type errors

  2. capaj commented on Apr 11, 2025

    @capaj
    ContributorAuthor

    yes it works very nicely!

    this input:
    Image

    renders as this jsonSchema:
    Image

  3. added a commit that references this issue on Jun 3, 2025
    836788f
  4. github-actions commented on Jun 4, 2025

    @github-actions
    Contributor

    This issue has been locked because we are very unlikely to see comments on closed issues. If you are running into a similar issue, please create a new issue. Thank you.

  5. locked as resolved and limited conversation to collaborators on Jun 4, 2025
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