parroty / exvcr

HTTP request/response recording library for elixir, inspired by VCR.
MIT License
714 stars 133 forks source link

Add support for Maps on request_body matcher #210

Closed scudelletti closed 10 months ago

scudelletti commented 11 months ago

Hello there! 👋 First of all thanks for maintaining this library! It's awesome and I use it a lot!

I've noticed that after upgrading to Elixir 1.15 - OTP 26 some tests started failing due to the order of keys/values changing when encoding the JSON body.

I know I can write a custom matcher or try to write a regexp but I believe this may be useful to more people too. Would such feature be of interest?

This PR implementation is not ideal so please let me know what implementation would you prefer in case you like the feature. I also thought about adding a new option like :request_on_json_body. I'm open to suggestions.

coveralls commented 11 months ago

Coverage Status

coverage: 89.969% (-2.3%) from 92.248% when pulling 1d4bb63167b2b5b47abbe9be61e8a459702fd166 on scudelletti:ds-support-json-body into 406af2df2842be49c30d4a9a3ce6620f9d4c2e17 on parroty:master.

coveralls commented 11 months ago

Coverage Status

coverage: 89.969% (-2.3%) from 92.248% when pulling 1d4bb63167b2b5b47abbe9be61e8a459702fd166 on scudelletti:ds-support-json-body into 406af2df2842be49c30d4a9a3ce6620f9d4c2e17 on parroty:master.

coveralls commented 11 months ago

Coverage Status

coverage: 92.438% (+0.2%) from 92.248% when pulling 1d4bb63167b2b5b47abbe9be61e8a459702fd166 on scudelletti:ds-support-json-body into 406af2df2842be49c30d4a9a3ce6620f9d4c2e17 on parroty:master.

parroty commented 10 months ago

Thanks for the PR, and I'm very sorry being late to respond 🙇 . I believe #211 is addressing the same issue, I am wondering 211 might be simpler implementation. Do you think merging 211 resolve the issue you're facing (or this one is better?). I appreciate your feedback 🙇 .

scudelletti commented 10 months ago

Hi @parroty, thank you for the reply, you are very kind.

I agree, #211 seems better suited and solves the same issue. I'll close this PR.

I wish you a lovely day! 🙇

parroty commented 10 months ago

Thank you for the PR and comments 🙇