Skip to content

chore(api-docs): enable allow_reuse to fix the docs #612

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Aug 19, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion aws_lambda_powertools/utilities/parser/models/apigw.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ class APIGatewayEventRequestContext(BaseModel):
routeKey: Optional[str]
operationName: Optional[str]

@root_validator
@root_validator(allow_reuse=True)
def check_message_id(cls, values):
message_id, event_type = values.get("messageId"), values.get("eventType")
if message_id is not None and event_type != "MESSAGE":
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class CloudWatchLogsDecode(BaseModel):
class CloudWatchLogsData(BaseModel):
decoded_data: CloudWatchLogsDecode = Field(None, alias="data")

@validator("decoded_data", pre=True)
@validator("decoded_data", pre=True, allow_reuse=True)
def prepare_data(cls, value):
try:
logger.debug("Decoding base64 cloudwatch log data before parsing")
Expand Down
2 changes: 1 addition & 1 deletion aws_lambda_powertools/utilities/parser/models/kinesis.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class KinesisDataStreamRecordPayload(BaseModel):
data: bytes # base64 encoded str is parsed into bytes
approximateArrivalTimestamp: float

@validator("data", pre=True)
@validator("data", pre=True, allow_reuse=True)
def data_base64_decode(cls, value):
try:
logger.debug("Decoding base64 Kinesis data record before parsing")
Expand Down
2 changes: 1 addition & 1 deletion aws_lambda_powertools/utilities/parser/models/sns.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class SnsNotificationModel(BaseModel):
Timestamp: datetime
SignatureVersion: str

@root_validator(pre=True)
@root_validator(pre=True, allow_reuse=True)
def check_sqs_protocol(cls, values):
sqs_rewritten_keys = ("UnsubscribeURL", "SigningCertURL")
if any(key in sqs_rewritten_keys for key in values):
Expand Down