serde-wasm-bindgen icon indicating copy to clipboard operation
serde-wasm-bindgen copied to clipboard

Add `to_value_with`

Open fosskers opened this issue 3 years ago • 6 comments

This allows Serializer::serialize_maps_as_objects to actually be used.

fosskers avatar Dec 20 '21 19:12 fosskers

This allows Serializer::serialize_maps_as_objects to actually be used.

It can already be used via value.serialize(...).

RReverser avatar Dec 20 '21 20:12 RReverser

True. If that's the preferred way, then it should be documented somewhere.

fosskers avatar Dec 21 '21 04:12 fosskers

Hm. It's the standard Serde method, it seemed unnecessary to also document it in just another one of Serde's implementations.

RReverser avatar Dec 21 '21 11:12 RReverser

My intent is that a full example of how to activate serialize_maps_as_objects should be present somewhere. While serialize is indeed a standard serde method, most cases of serialization use the shortcuts provided by the various libraries.

If you prefer I could add such an example to the main module docstrings in #26 .

fosskers avatar Dec 22 '21 03:12 fosskers

Adding a doc comment makes sense. Let's add it in a separate PR though, it's a lot easier to review bite-sized changes :)

RReverser avatar Dec 22 '21 17:12 RReverser

Sure, then I'll add it to the module docstring and README once the other PRs are merged (if you merge them :laughing: )

fosskers avatar Dec 22 '21 17:12 fosskers

I'm going to close this as per the old discussion above. If you think the docs need to call out the .serialize() method, let's do that in a separate PR.

RReverser avatar Oct 22 '22 02:10 RReverser