Update to_json Indent Type Annotation#262
Open
jdmoldenhauer wants to merge 1 commit intocloudtools:mainfrom
Open
Update to_json Indent Type Annotation#262jdmoldenhauer wants to merge 1 commit intocloudtools:mainfrom
jdmoldenhauer wants to merge 1 commit intocloudtools:mainfrom
Conversation
Updated the to_json methods indent type annotation on the AWSObject, and AWSHelperFn to allow for None. Added unit tests to ensure the string representation is correct. Sending an integer, or string to 'json.dumps' indent parameter results in a pretty printed json string with new lines in it. Sending in None results in the most compact representation.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Updated the
to_jsonmethods indent type annotation on theAWSObject, andAWSHelperFnto allow for None. Added unit tests to ensure the string representation is as expected.Sending an integer, or string to
json.dumpsindent parameter results in a pretty printed json string with new lines in it. Sending in None results in the most compact representation.For example:
This change allows for the last option, sending in
Noneto get the most compact representation.I have no idea if this is a desired change, and I apologize if I should have opened an issue first. The change was so small though I figured why not just open a PR, and if this change isn't desired we can talk about it here. No worries if this isn't something desired for the code base.
Thank you!