Open jmorey opened 9 years ago
@whitlockjc is there potentially an issue in swagger-tools causing this?
swagger-tools is using the default bodyParser.json() which only handles application/json
.
In order to support additional content types, go to your app.js
and add the following:
// at the top
var bodyParser = require('body-parser');
// before swaggerExpress.register(app);
app.use(bodyParser.json({ type: ['application/json', 'application/json-patch+json'] }));
see https://github.com/apigee-127/swagger-tools/issues/244 for related discussion
@moldi nailed it.
I have recently started using swagger-node-testify and am having a problem with supporting PATCH. Things work fine when I have the PATCH consume application/json but every call fails with a schema validation of the body when I change it to consume application/json-patch+json. I am pretty sure I am sending a valid PATCH body. Is this a problem with swagger-node-testify?
Thanks.