surpher / PactSwiftMockServer

A Swift wrapper around `libpact_ffi` and exposed as XCFramework
https://github.com/surpher/PactSwift
MIT License
4 stars 2 forks source link

Bug: ... #9

Open thomas-chris opened 8 months ago

thomas-chris commented 8 months ago

🌎 Environment

πŸ’¬ Description

At point of calling public func finalize(pact: Data, completion: ((Result<String, MockServerError>) -> Void)?) my pact data has the correct consumer and provider (as far as i can tell. I am debugging up to the point I can, i can see the consumer and provider set as I expect)

The end result however is a file that is called consumer.provider.json that does not match my expected output file. It also does not overwrite/merge changes and finally the content of the file ends up looking like

"consumer": { "name": "consumer" },

🦢 Reproduction Steps

Reproduction steps are tricky - we are using this is a VAPOR API, not an xcode project and therefor have some extra wrappers. However i can see my data all the way down to this level, then it suddenly changes.

πŸ€” Expected Results

"consumer": { "name": "consumer" }, should end up with name matching what i have set the consumer to be, not defaulted to consumer.

😲 Actual Results

"consumer": { "name": "consumer" } name has defaulted to consumer

surpher commented 6 months ago

@thomas-chris There was a major refactor done with 172d2c5b, can you update your wrapper to interact with the new interface and check whether the bug persists?

This refactor moves most of the pact building logic and responsibility into libpact_ffi instead of relying on PactSwift to build the Pact's structure and pass it into FFI.