Tag Info

Hot answers tagged

6

There is no theoretical limit to how deep JSON objects can be nested, but there usually is a practical limit based on the decoder being used. For example, PHP's json_decode() has a default limit of 512 levels, though it can be adjusted. Read the documentation for the code using the JSON to determine the max depth. If your JSON is actually hitting depth ...


3

404 is perfectly fine for this use case. 4xx status codes are client error codes, so browser treats them as such, and that is perfectly fine too. Another kind of APIs (e.g. JSON-RPC) use different approaches, but since you're going RESTful, do not change response code just to make console output look pretty - it is not a use case, users are not supposed to ...


2

From the comments... if everything else you have is C++ then the best answer is to write it in C++, building a mish-mash of different bits of programming languages is a right PitA to maintain and support. So, if you have C++ and need to resolve XML to JSON, it seems obvious to use the xml2json library that you linked to. It comes with sources so you can ...


1

You could consider changing the value for updated_properties to an object instead of an array and list the new value right in the list of updated properties. This will reduce the overall size of the message. { "event": "update", "appointment_id": 123, "updated_properties: { "place": "some new location", "time": "some new time" ...


1

Like others, I will question the need for C++. If you consider JAVA programming, instead of C++ (Meanwhile, I enjoy programming in ANSI-C, but I think your priority is a rapid development, instead of the joy of programming). Please check the site http://www.json.org/java/ Actually http://www.json.org/java/ might give you also some ideas for C++ libraries. ...



Only top voted, non community-wiki answers of a minimum length are eligible