You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am using genson 1.4 and jersey 2.12. I set the @produces annotation to handle both XML & JSON such that I get XML back as the default. Technically, the first type in the @produces annotation list should be used for the returned format if the Accept header isn't specified. However, I'm getting JSON back if the Accept header with application/xml isn't included in the curl command. If I specify -H "Accept: application/xml" in the curl command, I get back the XML representation (see example below). Also, if I just specify @produces({ MediaType.APPLICATION_XML}), I get back the XML representation.
Email from Eugen Cepoi [email protected] below written on Dec 5, 2019 suggests to return false in isWriteable/isReadable if mediaType != MediaType.APPLICATION_JSON_TYPE in GensonJsonConverter:
I am using genson 1.4 and jersey 2.12. I set the @produces annotation to handle both XML & JSON such that I get XML back as the default. Technically, the first type in the @produces annotation list should be used for the returned format if the Accept header isn't specified. However, I'm getting JSON back if the Accept header with application/xml isn't included in the curl command. If I specify -H "Accept: application/xml" in the curl command, I get back the XML representation (see example below). Also, if I just specify @produces({ MediaType.APPLICATION_XML}), I get back the XML representation.
Example:
Email from Eugen Cepoi [email protected] below written on Dec 5, 2019 suggests to return false in isWriteable/isReadable if mediaType != MediaType.APPLICATION_JSON_TYPE in GensonJsonConverter:
The text was updated successfully, but these errors were encountered: