Uploaded image for project: 'Ambari'
  1. Ambari
  2. AMBARI-6028

Views: View managed resources need @Produces({"text/plain"}) to generate JSON

    XMLWordPrintableJSON

Details

    • Task
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • 1.6.1
    • None
    • None

    Description

      For managed resource GET calls I wanted JSON response.

      {
       "a": "b"
      }
      

      Keeping

      @Produces({"application/json"})

      on the @GET method gives a string-serialized output of the JSON

      "{\"a\":\"b\"}"
      

      However when I keep

      @Produces({"text/plain", "application/json"})

      correctly produces JSON.

      Attachments

        Activity

          People

            tbeerbower Tom Beerbower
            tbeerbower Tom Beerbower
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: