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

dateTime matcher optional support #1797

Open
s1apped opened this issue May 14, 2024 · 2 comments
Open

dateTime matcher optional support #1797

s1apped opened this issue May 14, 2024 · 2 comments

Comments

@s1apped
Copy link

s1apped commented May 14, 2024

Hi,

I wanted to use formatter optional functionality to match dateTime e.g
datetime("start", "yyyy-MM-dd'T'HH:mm:ss[.[SSSSSSSSS][SSSSSSSS][SSSSSSS][SSSSSS][SSSSS][SSSS][SSS][SS][S]]'Z'", Instant.now());

It looks like it should on provider side (checked by debugging matcher) but consumer is having problems and generates

"start":"2024-05-13T21:35:44.801971000801971008019710801971801978019801808Z

Is this supported / am I doing something wrong?

Thanks!

@rholshausen
Copy link
Contributor

Why would you want to use such a format? Just give the max number of digits expected: 3 for microsecond precision and 6 or 9 for nanosecond precision.

What you have given will provide the seconds fraction over and over.

@s1apped
Copy link
Author

s1apped commented May 27, 2024

Using this format I can parse String date with ranging from 2024-05-13T21:35:44 to 2024-05-13T21:35:44.123456789. The example is little extreme but the idea was to have a bit more flexible contract where Consumer doesn't care about milis so when Provider will start sending with precision 5 instead of 3 contract isn't broken

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

No branches or pull requests

2 participants