Actual:
req.body = { status: 'Draft' }
Expected:
req.body = {}
Steps to Repo:
- Configure endpoint with this following doc:
export const patch = [(req, res, next) => {
console.log(req.body);
res.status(204).end();
}];
patch.apiDoc = {
"x-express-openapi-disable-defaults-middleware": true,
requestBody: {
required: true,
"application/json": {
schema: {
additionalProperties: false,
properties: {
status: {
type: "string",
default: "Draft",
},
},
},
},
},
};
- Console log the request body after making a PATCH command
curl -X PATCH --data '{}' -H "content-type: application/json" http://localhost:8080/blah/1
Thoughts:
- Was this caused by this PR
- I was trying to opt-out of defaults middleware as described here
Actual:
req.body = { status: 'Draft' }
Expected:
req.body = {}
Steps to Repo:
Thoughts: