pierresouchay / consul-rust

Rust client libray for Consul HTTP API
Apache License 2.0
92 stars 48 forks source link

KV put stores value with quotes #68

Open theirix opened 1 year ago

theirix commented 1 year ago

Allows to put unmodified data to Consul KV. Currently written value is always quoted.

Closes #49

pierresouchay commented 1 year ago

Hello @theirix,

This is a very nice change (and it should have been done that way from scratch).

This is also unfortunately a breaking change for people relying on the old behavior for put.

So, I would just change this PR to add a new method (and mark the old one as deprecated) and keep put with existing behavior and marking it as deprecated.

Other possible change, we increase the version number semantically and explain in changelog this is a breaking change.

Regards

theirix commented 1 year ago

Hello, @pierresouchay . Thank you for reviewing the PR. You are right, original KV::put should be kept for compatibility. I have added a new KV::put_raw for updated behaviour. Original KV::put can be used as a public API and in other modules like catalog where JSON serialization is needed (so no need in deprecation).

theirix commented 4 months ago

Hi Pierre, Could this improvement be merged? It's backwards compatible, so we don't even need to break semantic versioning.