You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
SSM plugin: SendCommand returns DateTime as JSON string but Go SDK expects JSON Number — deserialization failure #261
SendCommand fails with a deserialization error when called via the AWS Go SDK v2:
operation error SSM: SendCommand, https response error StatusCode: 200, RequestID: ,
deserialization failed, failed to decode response body,
expected DateTime to be a JSON Number, got string instead
Root Cause
The SSM SDK uses application/x-amz-json-1.1 (JSON protocol), so the response format is correct — unlike #260 (IAM). However, the SSM plugin serializes timestamp fields as RFC3339 strings (e.g. "2026-04-02T00:00:00Z") when the SDK's JSON protocol for SSM requires timestamps as Unix epoch seconds (float64).
The Go SDK's smithy-go deserializer for DateTime fields in JSON protocol services expects a number like 1743552000.0, not an ISO 8601 string.
Reproduction
ts:=substrate.StartTestServer(t)
// ... configure aws.Config pointing to ts.URL ...ssmClient:=ssm.NewFromConfig(cfg)
_, err:=ssmClient.SendCommand(ctx, &ssm.SendCommandInput{
DocumentName: aws.String("AWS-RunShellScript"),
InstanceIds: []string{"i-test12345678"},
Parameters: map[string][]string{"commands": {"echo hello"}},
})
// err = "deserialization failed, failed to decode response body,// expected DateTime to be a JSON Number, got string instead"
Fix
In ssm_plugin.go, serialize all time.Time fields as Unix epoch float64 instead of RFC3339 strings when building JSON responses:
Affected fields in SendCommand response: RequestedDateTime on the Command object.
Affected fields in GetCommandInvocation response: ExecutionStartDateTime, ExecutionElapsedTime, ExecutionEndDateTime.
Scope
Any SSM JSON response field typed as timestamp in the SSM API model will have this issue. Worth auditing all timestamp fields in ssm_plugin.go responses.
This is distinct from #260 (IAM protocol mismatch) — SSM correctly uses JSON protocol but uses the wrong timestamp encoding.
Discovered Via
Integration testing Prism against Substrate in pkg/aws/substrate_integration_test.go (TestSubstrateSSMRunCommand).
Activity
Release v0.45.7: IAM XML protocol + SSM timestamp fix (#260, #261, #262)