Skip to content
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

Support alternate date formats in StateMachine.fromJson(). #3095

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Commits on Feb 16, 2024

  1. Support alternate date formats in StateMachine.fromJson().

    This commit fixes issue aws#2130.
    
    Currently, `StateMachine.fromJson(...)` can parse JSON documents with timestamps in the format `2016-03-14T01:59:00.000Z` but it fails to parse JSON documents with timestamps in the format `2016-03-14T01:59:00Z`.
    
    This is because we currently use `org.joda.time.format.ISODateTimeFormat.dateTime().parseDateTime(...)`, which requires fractional seconds in timestamps, for JSON date deserialization.
    
    According to the documentation and examples in the AWS StepFunction documentation, fractional seconds in timestamps are optional.
    
    This PR changes the date parsing logic to use `com.amazonaws.util.DateUtils.parseISO8601Date(...)` to parse dates during JSON deserialization. This method supports both the date format with fractional seconds and without fractional seconds.
    
    This PR does not change the JSON serialization format of dates.
    mcvayc committed Feb 16, 2024
    Configuration menu
    Copy the full SHA
    308f21c View commit details
    Browse the repository at this point in the history