Uploaded image for project: 'RESTEasy'
  1. RESTEasy
  2. RESTEASY-1157

@XmlTransient doesn't work for JSON responses

    XMLWordPrintable

Details

    • Bug
    • Resolution: Obsolete
    • Major
    • None
    • None
    • jaxrs
    • None

    Description

      Using Jackson provider, the JAXB @XmlTransient annotation works fine for XML responses, but doesn't for JSON.

      With the following JAXB class:

          private String ignored;
          @XmlTransient
          public String getIgnored() { return ignored; }
      

      for "application/xml" I got:

      <return>
        <message>
          <content>Goodbye, RESTEasy!</content>
        </message>
      </return>
      

      but for "application/json" I got:

      {
        "message" : {
          "content" : "Hello, RESTEasy!",
          "ignored" : "Ignore me!!!"
        }
      }
      

      This issue happens only with RESTEasy 2.x. I confirmed it doesn't happen with RESTEasy 3.x.

      Attachments

        Activity

          People

            psotirop@redhat.com Panagiotis Sotiropoulos
            rhn-support-tasato Tadayoshi Sato
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: