Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support alternate date formats in StateMachine.fromJson().
This commit fixes issue #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.
- Loading branch information