LukeMathWalker / wiremock-rs

HTTP mocking to test Rust applications.
Apache License 2.0
617 stars 70 forks source link

Fix body_json matching and implement Partial json matching #83

Closed 95th closed 2 years ago

95th commented 2 years ago

Fix body_json matching and implement Partial json matching.

Closes https://github.com/LukeMathWalker/wiremock-rs/issues/79

LukeMathWalker commented 2 years ago

Hey! Thanks for the PR - the fix looks alright, but I'd prefer to avoid introducing breaking changes for this issue. Could you rework the implementation to backwards-compatible?

95th commented 2 years ago

@LukeMathWalker I changed it to use an enum for body and kept the member functions.

LukeMathWalker commented 2 years ago

Looking good! The partial JSON matcher is its own feature and it should be its own matcher - having a partial method on something named BodyExactMatcher is not great.

95th commented 2 years ago

yes. I thought so. let me move it out.

95th commented 2 years ago

How about in BodyContainsMatcher -- could call the standalone function body_contains_json - because that's what it checks? Or a separate type?

95th commented 2 years ago

Too late. already done.

LukeMathWalker commented 2 years ago

Thanks for the PR!