go icon indicating copy to clipboard operation
go copied to clipboard

added fuzzy decoding for booleans, added ability to decode numeric keyed objects as arrays with fizzy decoder

Open masterada opened this issue 5 years ago • 3 comments

rel https://github.com/json-iterator/go/issues/486

  • decode the followings as boolean: "true", "false", 0, 1, "0", "1".
  • allow unmarshalling numeric keyed objects with strictly increasing keys as array, eg: {"0": "a", "2": "b"}

The later is neccessary because of the "unset" php method, eg:

<?php

$a = ["a", "b", "c"];
echo json_encode($a); // prints ["a","b","c"]

unset($a[1]);
	
echo json_encode($a); // prints {"0":"a","2":"c"}

masterada avatar Oct 13 '20 11:10 masterada

@taowen @AllenX2018 can some1 take a look at this please?

masterada avatar Oct 19 '20 11:10 masterada

@AllenX2018 Could you check this out? Would be nice to see these changes in one of the following releases.

pongraczgabor87 avatar Aug 03 '21 06:08 pongraczgabor87

@taowen Would you have time to look into this?

pongraczgabor87 avatar Jan 13 '22 08:01 pongraczgabor87