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

Feature: Rust implementation of DateTime Expressions #180

Closed
surpher opened this issue Feb 14, 2022 · 1 comment
Closed

Feature: Rust implementation of DateTime Expressions #180

surpher opened this issue Feb 14, 2022 · 1 comment

Comments

@surpher
Copy link

surpher commented Feb 14, 2022

When writing consumer tests in a Pact implementation that uses rust-core for mock server
I want to be able to define date time expressions
So that the generators inform the provider verification how/with what to verify a specific DateTime value

This refers to: https://pactflow.io/blog/dealing-with-relative-dates-in-contract-tests/

Given a pact where the response should be:

{
 "id": "321",
 "start": "today +1 day @ 6 o'clock pm"
}

note: I'm not sure about the above though as I just copy pasted from the pact implementation issue board. I would imagine the "start" value would need to be in the provided "format"?

Example Pact output:

"generators": {
 "body": {
  "$.start": {
   "type": "DateTime",
   "format": "yyyy-MM-dd'T'HH:mm:ss'Z'",
   "expression": "today +1 day @ 6 o'clock pm"
  }
 }
}

Related to: DiUS/pact-consumer-swift#128

@surpher
Copy link
Author

surpher commented Mar 5, 2022

Pulled the libpact_ffi-v0.2.3 into PactSwift successfully. Closing and considering implemented 👍

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