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
{{ message }}
This repository has been archived by the owner on Jan 11, 2019. It is now read-only.
When responses are in XML format, the plugin tries to run them through the JSON parser, resulting in a failure on every XML response.
I was able to fix this by making the following modifications to SwaggerComplianceAssertion.java in validatePayload():
CHANGE:
JsonNode contentObject = Json.mapper().readTree(payload);
TO:
if (contentType.equalsIgnoreCase("application/json")) { final ObjectMapper jsonMapper = new ObjectMapper(); contentObject = jsonMapper.readTree(payload); } else if (contentType.equalsIgnoreCase("application/xml")) { final XmlMapper xmlMapper = new XmlMapper(); contentObject = xmlMapper.readTree(payload); } else { throw new AssertionException( new AssertionError("Swagger Compliance testing failed. Invalid content type: " + contentType)); }
"contentType" is passed into validatePayload() as a parameter. Of course there may be a cleaner way to do this.
The text was updated successfully, but these errors were encountered: