Loading ...
Sorry, an error occurred while loading the content.

Re: [json] Guidance on standard JSON output.

Expand Messages
  • Stephan Beal
    ... i have a bit of experience in this area, e.g.: https://docs.google.com/document/d/1fXViveNhDbiXgCuE7QDXQOKeFzf2qNUkBEgiUvoqFN4/view
    Message 1 of 2 , Mar 14, 2012
    View Source
    • 0 Attachment
      On Wed, Mar 14, 2012 at 5:59 PM, Venkat M <venkat_yum@...> wrote:

      > **
      >
      > Now I have a standardization question.
      > I currently have about 15 calls (it
      > may increase). Is it advised to have a same JSON o/p pattern for all the
      > calls?
      >

      i have a bit of experience in this area, e.g.:

      https://docs.google.com/document/d/1fXViveNhDbiXgCuE7QDXQOKeFzf2qNUkBEgiUvoqFN4/view
      http://whiki.wanderinghorse.net/

      and personally recommend using an evelope+body model, for both the requests
      and response. i've tried the approach you're using (from what i
      understand), and IMO it's not as scalable. It works fine for small APIs,
      but i have come to prefer the extra level of an envelope for
      framework/global-level properties and a payload/body for the app-level data
      because it ensures that both the clients and the framework won't step on
      each other's data (i.e. they have separate namespaces). The above document
      demonstrates what i currently use in my various JSON back-ends. Rather than
      roll your own, you might want to pick some library which already handles
      such communication, leaving the client to only deal with creating the
      requests and handling the responses. If you're interested, write me
      off-list and i can give you a JS class i've been evolving the past several
      years (and actively use on at least 5 projects) which provides a generic
      client-side API for handling arbitrary JSON-based back-ends.

      --
      ----- stephan beal
      http://wanderinghorse.net/home/stephan/
      http://gplus.to/sgbeal


      [Non-text portions of this message have been removed]
    Your message has been successfully submitted and would be delivered to recipients shortly.