Closed marcelinoagile closed 2 years ago
Seems like your back-end colleague is using Pact-JVM that is generating pact contract spec v3. pact-consumer-swift only supports pact spec v2 which does not handle generators.
@marcelinoagile You might want to look at https://github.com/surpher/PactSwift which supports pact v3.
Thanks @andrewspinks will take a look
Feature implemented in PactSwift on a branch feature/generator/datetime-expression
for now (https://github.com/surpher/PactSwift/tree/feature/generator/datetime-expression).
Example usage:
.willRespondWith(
status: 201,
body: [
"start": ExampleGenerator.DateTimeExpression(expression: "@ next hour", format: dateFormat)
]
)
Hi, I'm using your library and it works like a charm. The problem is that now I'm trying to add "dynamic" dates to the pact and I can't find the way to do it. Given a pact where the response should be:
... my backend colleague is adding the following object to the body using the Pacts Java library:
object.datetimeExpression("start", "today +1 day @ 6 o'clock pm", "yyyy-MM-dd'T'HH:mm'Z'");
And the datetime expression generates:
But unfortunately I don't find the way to do it using this library.
Could you help me? Thank you in advance.