Skip to content

Maintenance: JSONStringified helper does not infer return type #2945

Closed
@dreamorosi

Description

@dreamorosi

Summary

In 2.7.0 we introduced a new helper in the Parser utility, which helps customers to extend built-in Zod schemas that have a stringified body.

The helper, while working at runtime, currently sets the return type of the parsed object to any, which defeats the purpose of the DX improvement that the helper was supposed to bring.

We should

Why is this needed?

So that customers using the helper can have the correct type on the parsed field.

Which area does this relate to?

Parser

Solution

Follow Zod best practices around writing generic functions.

Acknowledgment

Future readers

Please react with 👍 and your use case to help us understand customer demand.

Metadata

Metadata

Assignees

Labels

completedThis item is complete and has been merged/shippedinternalPRs that introduce changes in governance, tech debt and chores (linting setup, baseline, etc.)parserThis item relates to the Parser Utility

Type

No type

Projects

Status

Shipped

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions