Skip to content

feat(data-classes): decode json_body if based64 encoded #560

New issue

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

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

Already on GitHub? # to your account

Merged
merged 2 commits into from
Jul 27, 2021

Conversation

michaelbrewer
Copy link
Contributor

@michaelbrewer michaelbrewer commented Jul 23, 2021

Issue #, if available:

Description of changes:

Use decoded_body for the body in json_body. This will allow for a json string that is base64 encoded to be decoded and parsed in one go.

Checklist

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@pull-request-size pull-request-size bot added the size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. label Jul 23, 2021
@codecov-commenter
Copy link

codecov-commenter commented Jul 23, 2021

Codecov Report

Merging #560 (350ef03) into develop (cf001a6) will not change coverage.
The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff            @@
##           develop     #560   +/-   ##
========================================
  Coverage    99.86%   99.86%           
========================================
  Files          113      113           
  Lines         4485     4485           
  Branches       243      243           
========================================
  Hits          4479     4479           
  Misses           3        3           
  Partials         3        3           
Impacted Files Coverage Δ
...lambda_powertools/utilities/data_classes/common.py 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update cf001a6...350ef03. Read the comment docs.

@pull-request-size pull-request-size bot removed the size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. label Jul 23, 2021
@boring-cyborg boring-cyborg bot added the tests label Jul 23, 2021
@pull-request-size pull-request-size bot added the size/S Denotes a PR that changes 10-29 lines, ignoring generated files. label Jul 23, 2021
@michaelbrewer
Copy link
Contributor Author

@heitorlessa it is a pretty small change, if you want to have a look

@heitorlessa
Copy link
Contributor

Oh, I thought I did!! Thanks for the nudge

@@ -65,7 +65,7 @@ def body(self) -> Optional[str]:
@property
def json_body(self) -> Any:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we fix the older type annotation you Dict[str, Any] here too?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It could be a list too :)

@heitorlessa
Copy link
Contributor

heitorlessa commented Jul 27, 2021 via email

@heitorlessa heitorlessa changed the title feat(data-classes): use decoded_body for json_body feat(data-classes): decode json_body if based64 encoded Jul 27, 2021
@heitorlessa heitorlessa added the feature New feature or functionality label Jul 27, 2021
@heitorlessa heitorlessa merged commit 1135314 into aws-powertools:develop Jul 27, 2021
@michaelbrewer michaelbrewer deleted the feat-decoded-json-body branch July 27, 2021 06:35
heitorlessa added a commit that referenced this pull request Jul 30, 2021
* develop:
  feat(params): expose high level max_age, raise_on_transform_error (#567)
  fix(parser): apigw wss validation check_message_id; housekeeping (#553)
  chore(deps-dev): bump isort from 5.9.2 to 5.9.3 (#574)
  feat(data-classes): decode json_body if based64 encoded (#560)
  chore(deps-dev): bump mkdocs-material from 7.2.0 to 7.2.1 (#566)
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
feature New feature or functionality size/S Denotes a PR that changes 10-29 lines, ignoring generated files. tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants