json2object icon indicating copy to clipboard operation
json2object copied to clipboard

JsonParser(errors, putils, errorType) are undocumented

Open EliteMasterEric opened this issue 1 year ago • 2 comments

The arguments to JsonParser are not documented at all, I was trying to figure out if "Unknown variable" can be set to be ignored.

  • errors is an existing array to be populated with errors
  • putils is what?
  • errorType is what?

EliteMasterEric avatar Dec 19 '23 03:12 EliteMasterEric

Hello

putils and errorType are only used internally and there is almost no reason to use them. putils is used to determine the location of problems. errorType is used to determine how error in subobjects are handled.

errors will contains all the error/warning raised during the parsing. You can't ask to ignore the errors but you are in full control of what to do with the errors.

elnabo avatar Dec 20 '23 18:12 elnabo

I ended up making a patch on my fork which includes the ability to ignore the UnknownVariable error type so I can successfully retrieve a value if there are extra values in the JSON.

EliteMasterEric avatar Dec 20 '23 20:12 EliteMasterEric