MousaZeidBaker / aws-lambda-typing

Python type hints for AWS Lambda
MIT License
106 stars 19 forks source link

Values that can be null should be Optional #79

Closed AGiantSquid closed 1 year ago

AGiantSquid commented 1 year ago

Certain fields are able to be null values. For example, here are the AWS docs for an API Gateway Event:

image

https://docs.aws.amazon.com/lambda/latest/dg/services-apigateway.html#apigateway-example-event

This body field, for example, is currently set to str

https://github.com/MousaZeidBaker/aws-lambda-typing/blob/master/src/aws_lambda_typing/events/api_gateway_proxy.py#L181

I think it should be body: Optional[str]

Let me know if I should do a PR

MousaZeidBaker commented 1 year ago

Thanks for reporting an issue @AGiantSquid

If you like so, please open a PR. Keep in mind, in TypedDict terms, Optional[str] means str or None not potentially-missing, see here. For potentially-missing keys, the totality of the dict must be set to false.

MousaZeidBaker commented 1 year ago

closed by #80