Skip to content

Feature request: Export the parse function within the parser package #4263

@nateiler

Description

@nateiler

Use case

The [parse](https://github.com/aws-powertools/powertools-lambda-typescript/blob/main/packages/parser/src/parser.ts) function is valuable but not exported from the parser package. The middleware and decorator use it, however it would also be useful in manual parsing scenarios too; specifically because it throws a parse error which can handled uniformly with other middleware.

Solution/User Experience

Parsing an API Gateway Proxy Event query string parameters

const params = parse(event.queryStringParameters, undefined, QuerySchema);

And we could expect to uniformly handle a parse error whether it happens from a failed body or query string parameters.

Alternative solutions

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/shippedfeature-requestThis item refers to a feature request for an existing or new utilityparserThis 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