json_macros icon indicating copy to clipboard operation
json_macros copied to clipboard

make json_macros compatible with serde 0.9.x

Open yannleretaille opened this issue 8 years ago • 5 comments
trafficstars

  • serde_json 0.9.x uses serde_json::Map instead of BTreeMap
  • added tests for (pretty)printing
  • passes all tests for rustc-serialize and serde_json

Now that serde introduced its own json! macro, you might consider dropping support for serde in the next version.

yannleretaille avatar Feb 27 '17 03:02 yannleretaille

I would agree with dropping Serde support. I filed #34 to follow up.

@yannleretaille do you have any reasons for using this library with serde 0.9? What motivates the PR?

dtolnay avatar Feb 27 '17 03:02 dtolnay

@dtolnay Actually, I just didn't notice serde_json had introduced a macro until it was already ported :D There might be others who might appreciate that stuff just continues to work as it did before.

yannleretaille avatar Feb 27 '17 03:02 yannleretaille

Cool. I think the most valuable course of action would be to drop Serde support in this library in favor of serde_json's json! macro (#34) and use the logic from serde_json's json! macro to provide a stable version of this library that works with rustc-serialize (#35).

Although note that rustc-serialize is slated to be deprecated in Rust 1.18... see here.

dtolnay avatar Feb 27 '17 03:02 dtolnay

Sounds like a good plan! #35 looks fairly straightforward to implement and would make a lot of sense. For #34 I think it would be best to keep the feature flag and to either:

  • throw an error with instructions on how to move to serde_json::json
  • or throw a warning and use serde_jsons version

Farewell, json_macros, you served us well!

yannleretaille avatar Feb 27 '17 04:02 yannleretaille

If it were my library I wouldn't bother with either of those. Just put a prominent note in the readme and people will find it eventually.

dtolnay avatar Feb 27 '17 04:02 dtolnay