Skip to content

Update JSON formatter to encode bytes as Base64 strings. #9438

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
Apr 16, 2025

Conversation

aemous
Copy link
Contributor

@aemous aemous commented Apr 14, 2025

v1 port of #9424

Description of changes

  • Modifies JSON formatter so that it serializes bytes into a UTF-8 Base64 string.
  • Add a regression unit test to verify that binary data in the response gets base-64 encoded.

Description of tests

  • Call a service operation using the CBOR protocol and receive a response containing a member with raw bytes. Prior to this change, error code 255 is observed and the full response is not printed. After the change, the output is fully printed, and it matches the output seen when using the JSON protocol on the same operation.
  • Ran and passed all test suites and CI.

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

@aemous aemous requested review from ashovlin and a team April 14, 2025 14:27
@codecov-commenter
Copy link

codecov-commenter commented Apr 14, 2025

Codecov Report

Attention: Patch coverage is 75.00000% with 1 line in your changes missing coverage. Please review.

Project coverage is 93.40%. Comparing base (5f07db1) to head (7d69ab8).
Report is 65 commits behind head on develop.

Files with missing lines Patch % Lines
awscli/utils.py 75.00% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff            @@
##           develop    #9438   +/-   ##
========================================
  Coverage    93.39%   93.40%           
========================================
  Files          210      210           
  Lines        16983    16986    +3     
========================================
+ Hits         15861    15865    +4     
+ Misses        1122     1121    -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@aemous aemous merged commit 5de2e23 into aws:develop Apr 16, 2025
30 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants