Skip to content

Feature request: add TransferFamilySchema to Parser #3518

Closed
@dreamorosi

Description

@dreamorosi

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 in packagesparser/src/types/schema.ts & corresponding packagesparser/src/types/index (you can import the schema directly from the packages/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 and typesVersions 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 example packages/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

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 utilitygood-first-issueSomething that is suitable for those who want to start contributingparserThis 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