Skip to content

Remove usage of jsonutil #4626

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 1 commit into from
May 13, 2025
Merged

Remove usage of jsonutil #4626

merged 1 commit into from
May 13, 2025

Conversation

ShelbyZ
Copy link
Contributor

@ShelbyZ ShelbyZ commented May 7, 2025

Summary

Remove our usage of jsonutil.BuildJSON, etc and the imports to "github.com/aws/aws-sdk-go/private/protocol/json/jsonutil" from various code locations. For aws-sdk-go-v2 we do not have access to special JSON parsing and should rely on encoing/json.

Implementation details

  1. Remove github.com/aws/aws-sdk-go/private/protocol/json/jsonutil imports
  2. Replace jsonutil.BuildJSON usage with json.Marshal
  3. Replace jsonutil. UnmarshalJSON usage with json.Unmarshal
  4. Update awssdk.go (code generation for api clients) to replace locationName with json to align struct properties
  5. Update awssdk.go to add omitempty to struct properties that are not marked required:true
  6. Create new utils.go (ecs-agent) methods to handle serialization/deserialization based on aws-sdk-go v1 patterns to avoid issues with time.Time needing to be UTC seconds and not a timestamp string
  7. Add testing around new utils.go methods
  8. Regenerate api.go files (make gogenerate) to update acs/tcs APIs
  9. Cast time.Time to Timestamp where required (alias type)

Testing

  • Locally testing change files
  • make test
  • E2E testing

New tests cover the changes: yes

Description for the changelog

Enhancement: Migrate jsonutil to encoding/json for aws-sdk-go-v2 migration

Licensing

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@ShelbyZ ShelbyZ force-pushed the remove-jsonutil branch from b302aad to 1c7ff79 Compare May 7, 2025 18:32
@ShelbyZ ShelbyZ force-pushed the remove-jsonutil branch 2 times, most recently from 0b16d02 to d668edd Compare May 8, 2025 15:42
@ShelbyZ ShelbyZ force-pushed the remove-jsonutil branch from 3b16151 to 6f9dde5 Compare May 9, 2025 23:02
@ShelbyZ ShelbyZ changed the title [wip] Remove usage of jsonutil Remove usage of jsonutil May 9, 2025
@ShelbyZ ShelbyZ force-pushed the remove-jsonutil branch from 6f9dde5 to a321d6e Compare May 9, 2025 23:12
@ShelbyZ ShelbyZ marked this pull request as ready for review May 10, 2025 00:00
@ShelbyZ ShelbyZ requested a review from a team as a code owner May 10, 2025 00:00
@ShelbyZ ShelbyZ merged commit d8fd803 into aws:dev May 13, 2025
40 checks passed
@ShelbyZ ShelbyZ deleted the remove-jsonutil branch May 13, 2025 16:09
@danehlim danehlim mentioned this pull request May 20, 2025
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.

4 participants