Skip to content

Commit

Permalink
chore(api-docs): enable allow_reuse to fix the docs (#612)
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael Brewer authored Aug 19, 2021
1 parent 1b07c45 commit 4745070
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
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

0 comments on commit 4745070

Please sign in to comment.