pact-foundation / pact-reference

Reference implementations for the pact specifications
https://pact.io
MIT License
91 stars 46 forks source link

Java SimpleDateFormat format limitation #279

Closed namelivia closed 5 months ago

namelivia commented 1 year ago

I have a field that contains timestamps like: 2023-05-25T14:25:53.737475Z up to 6 decimals of a second.

Looking at the documentation there is no way to express this using SimpleDateFormat, if I generate a format string like: yyyy-MM-dd'T'HH:mm:ss.SSSSSSZ and try to validate the contract using the Rust standalone binary I get: Error(InvalidMillisecond("737475"))

I believe this is because of a limitation of the SimpleDateFormat string that only recognizes up to 3 decimals. Do you think this could be supported someday?

Thanks!