go-json-experiment / json

Experimental implementation of a proposed v2 encoding/json package
BSD 3-Clause "New" or "Revised" License
341 stars 11 forks source link

jsonv2.Marshal with jsonv1.DefaultOptionsV1 not equivalent to jsonv1 #16

Open gazerro opened 8 months ago

gazerro commented 8 months ago

jsonv2.Marshal(in, jsonv1.DefaultOptionsV1()) should be semantically equivalent to jsonv1.Marshal(in), but the former returns an error in the following cases

Also, the former clears the value when unmarshaling a JSON null into a non-nullable type.

dsnet commented 8 months ago

That is all expected at the moment. We haven't implemented all of the v1 compatibility layer. It will be a gradual process to get to 100% backwards compatibility.

gazerro commented 8 months ago

@dsnet In this case, feel free to close this issue. Thanks.