views:

52

answers:

1

Have a glance at this snippet of JSON.

Motivation: The JSON is generated by a REST service & later on will be converted to XML.

Simple Question: I am currently embedding the map for the error codes inside the JSON snippet, with the intention of helping the transformation to XML. The XML format does not use numeric codes. Should I place the mapping inside the JSON or inside the code that will do the transformation ? Thanks.

A: 

Instead of thinking of it as a map think of it as an enumerator.
Now it make more sense to put both value and its numeric value in the json.

Shay Erlichmen
Would you have done the same if you're designing a JSON structure of the same ilk ?
Jacques René Mesrine