Closed
Description
Use case
Powertools for AWS Lambda (Python) recently added a Parser built-in schema for customers who work with Transfer Family (aws-powertools/powertools-lambda-python#5903). We should do the same and add a schema to our version as well.
Note
If you're interested in picking this up please leave a comment to claim it. A maintainer will assign the issue to you and help you with reviewing your PR. Likewise, if you have any questions before starting, feel free to leave a comment below.
Solution/User Experience
Customers should be able to use the built-in schema the same way as they use all the other built-in ones. For example:
import { TransferFamilySchema } from '@aws-lambda-powertools/parser/schemas/transfer-family';
import type { TransferFamilyEvent } from '@aws-lambda-powertools/parser/types';
export const handler = middy(async (event: TransferFamilyEvent) => {
// ... handle event
}).use(
parser({ schema: TransferFamilySchema })
);
To work on the issue, we should:
- Add the new schema under
packages/parser/src/schemas/transfer-family.ts
- Add the
TransferFamilyEvent
type inpackagesparser/src/types/schema.ts
& correspondingpackagesparser/src/types/index
(you can import the schema directly from thepackages/parser/src/schemas/transfer-family.ts
file rather than adding it to the barrel file - which we want to move away from) - Add the export to the
packages/parser/package.json
exports here andtypesVersions
here - Add the new built-in schema to the table within the docs here
- Add the test event below at
packages/parser/tests/events/transfer-family/base.json
and write unit tests following the same style and conventions of the ones for other schemas, for examplepackages/parser/tests/unit/schema/alb.test.ts
{
"username": "value",
"password": "value",
"protocol": "SFTP",
"serverId": "s-abcd123456",
"sourceIp": "192.168.0.100"
}
Alternative solutions
N/A
Acknowledgment
- This feature request meets Powertools for AWS Lambda (TypeScript) Tenets
- Should this be considered in other Powertools for AWS Lambda languages? i.e. Python, Java, and .NET
Future readers
Please react with 👍 and your use case to help us understand customer demand.
Metadata
Metadata
Assignees
Labels
Type
Projects
Status
Shipped