I'm working with the RESTful plugin - and I was wondering how to properly (consistently) format the JSON output?
For example I have some object in code:
- Code: Select all
var oProblem = {
"id" : "",
"problem" : "",
"date_added" : "",
"date_resolved" : ""
}
Then I fill it up:
- Code: Select all
oProblem.id = xxxx;
oProblem.problem = "Problem";
.... etc ...
The issue is - when the JSON comes out - it's in a different order:
- Code: Select all
{
"date_resolved" : "",
"id" : xxxx,
"problem" : "Problem",
"date_added" : ""
}
Is there a way I can keep it in the order I've specified (so it will match my API schema)?
Thanks in advance!
Bob