Skip to content

Commit 3fceac7

Browse files
Polishing the PR with best practicies - Comments
1 parent e97f6ee commit 3fceac7

File tree

1 file changed

+4
-0
lines changed
  • aws_lambda_powertools/event_handler/openapi

1 file changed

+4
-0
lines changed

aws_lambda_powertools/event_handler/openapi/models.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,15 @@ class OpenapiExtensions(BaseModel):
2222

2323
@parser_openapi_extension()
2424
def serialize(self):
25+
# If the 'openapi_extensions' field is not None, return it
2526
if self.openapi_extensions:
2627
return self.openapi_extensions
2728

2829
else:
2930

31+
# If the 'openapi_extensions' field is present in the 'values' dictionary,
32+
# update the 'values' dictionary with the contents of 'openapi_extensions',
33+
# and then remove the 'openapi_extensions' field from the 'values' dictionary
3034
@parser_openapi_extension(pre=False, allow_reuse=True)
3135
def check_json(cls, values):
3236
if values.get("openapi_extensions"):

0 commit comments

Comments
 (0)