Ticket #46 (closed enhancement: fixed)

Opened 5 years ago

Last modified 5 years ago

Stripping of "root" in JSON representations

Reported by: jgou Owned by: jgou
Priority: minor Milestone: 0.3
Component: modules/kauri-dbresources Version: trunk
Keywords: Cc:

Description (last modified by jgou) (diff)

While XML has the requirement of using a single root tag, this is not at all required in JSON. However, the kauri database resources module uses a jettison lib for xml-like (de)serialization to/from JSON, which leads to the presence of a root object in the json output.
Since this is caused by an implementation detail, it might be better to hide this and provide an automatic stripping/wrapping mechanism.

  • Pro stripping:
    • users should not be aware of implementation consequences
    • json looks more like your regular json strings
  • Contra stripping:
    • easy to understand what you are looking at when handed a json fragment
    • resemblance with xml
    • more efficient implementation

Change History

comment:1 Changed 5 years ago by jgou

  • Status changed from new to assigned
  • Component changed from -- unknown -- to modules/kauri-dbresources
  • Description modified (diff)

comment:2 Changed 5 years ago by jgou

r356 makes it possible to turn on automatic stripping/wrapping (by default it is still disabled)

comment:3 Changed 5 years ago by mpo

  • Milestone changed from 0.2 to 0.3

moving to 0.3 for formal closure and strategy
feature is there, we just need to formally decide what the prefered (default) way of working should become

comment:4 Changed 5 years ago by jgou

After playing with the samples (especially the dbforms sample) for some time, it has become clear that the benefits of stripping the root tag easily outweigh the disadvantages.
Since the forms don't want to know about a FQN, stripping was eventually done there 'manually', so it makes more sense to present the json code directly in it's 'wanted' format.

comment:5 Changed 5 years ago by jgou

  • Status changed from assigned to closed
  • Resolution set to fixed

comment:6 Changed 5 years ago by jgou

we reached closure on this issue and decided to strip the root tag by default and present the json code in it's most natural form -> r603

Note: See TracTickets for help on using tickets.