Update to_json Indent Type Annotation #262
Open
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_json
methods indent type annotation on theAWSObject
, andAWSHelperFn
to allow for None. Added unit tests to ensure the string representation is as expected.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.For example:
This change allows for the last option, sending in
None
to 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!