Re: EuMVC:Map to Json
- Posted by petelomax Jan 07, 2022
- 751 views
ghaberek said...
You're right, there should be, but Euphoria isn't typed strongly enough to make a one-to-one translation from a map to JSON, so some type information has to be specified manually.
What I did, at least when parsing json and not that it has anything to do with maps, dunno if this will help:
•Numbers and Strings (without quotes) are held natively
•An object is held as a sequence with a first element of -1 (JSON_OBJECT),and the rest pairs, the first of which is a string and the second any of these types.
•An array is held as a sequence with a first element of -2 (JSON_ARRAY),and the rest any of these types.
•A keyword is held as a sequence with a first element of -3 (JSON_KEYWORD),and one of the strings "true", "false", or "null".