Uploaded image for project: 'CXF'
  1. CXF
  2. CXF-3861

Allow indentation of xml and json based on query parameter

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Won't Fix
    • 2.4.3
    • None
    • JAX-RS
    • None
    • Unknown

    Description

      I would like to be able to force indent based on a query parameter so that we are not indenting on every call, but only when we need to.

      For example,

      http://localhost:8080/services/customer?indent=true

      It would be nice if indent would accept (yes|y|true|on).

      The code might look as follows for the JaxbElementProvider (not sure about Json).

      In the marshal method:

      if (("on".equalsIgnoreCase(indent)) ||
      ("yes".equalsIgnoreCase(indent)) ||
      ("true".equalsIgnoreCase(indent)))

      { ms.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, Boolean.TRUE); }

      Attachments

        Activity

          People

            Unassigned Unassigned
            jasonchaffee Jason Chaffee
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: