Petals BC REST

Move from Jettison to Staxon for JSON<->XML conversion, customization via SU parameters

Details

  • Type: Improvement Request Improvement Request
  • Status: In Progress In Progress
  • Priority: Major Major
  • Resolution: Unresolved
  • Affects Version/s: 1.0.1-BC
  • Fix Version/s: 2.5.0-BC
  • Security Level: Public
  • Description:
    Hide

    Jettison is quite limited in the way it can be customized and its badgerfish conversion implementation is missing some important features (in particular to handle JSON document that would be converted to XML documents with multiple roots, something forbidden in XML).

    Staxon is an alternative implementation that supports an improved badgerfish conversion that is customizable.
    It is also more efficient in terms of memory usage and can use gson, jackson or jsr353 as the JSON reader/writer.

    Moving to Staxon introduces the following SU parameters (both for provides and consumes):

    http-body-to-json-multiple-pi default to false
    http-body-from-json-multiple-pi default to false
    
    http-body-to-json-virtual-root default to null
    http-body-from-json-virtual-root default to null
    
    http-body-to-json-auto-array default to false
    
    http-body-to-json-auto-primitive default to false
    
    http-body-to-json-pretty-print default to false
    
    http-body-to-json-ns-declarations default to false
    
    namespace-mapping/@prefix (value is the namespace URI, no mapping by default)

    See https://github.com/beckchr/staxon/wiki/Factory-Configuration for details.

    We could also introduce options to exploit XMLMultipleStreamWriter (see https://github.com/beckchr/staxon/wiki/Mastering-Arrays).

    Show
    Jettison is quite limited in the way it can be customized and its badgerfish conversion implementation is missing some important features (in particular to handle JSON document that would be converted to XML documents with multiple roots, something forbidden in XML). Staxon is an alternative implementation that supports an improved badgerfish conversion that is customizable. It is also more efficient in terms of memory usage and can use gson, jackson or jsr353 as the JSON reader/writer. Moving to Staxon introduces the following SU parameters (both for provides and consumes):
    http-body-to-json-multiple-pi default to false
    http-body-from-json-multiple-pi default to false
    
    http-body-to-json-virtual-root default to null
    http-body-from-json-virtual-root default to null
    
    http-body-to-json-auto-array default to false
    
    http-body-to-json-auto-primitive default to false
    
    http-body-to-json-pretty-print default to false
    
    http-body-to-json-ns-declarations default to false
    
    namespace-mapping/@prefix (value is the namespace URI, no mapping by default)
    See https://github.com/beckchr/staxon/wiki/Factory-Configuration for details. We could also introduce options to exploit XMLMultipleStreamWriter (see https://github.com/beckchr/staxon/wiki/Mastering-Arrays).
  • Environment:
    -

Activity

People

Dates

  • Created:
    Tue, 17 Jan 2017 - 14:33:13 +0100
    Updated:
    Tue, 11 Apr 2023 - 11:37:18 +0200