How to specify middleware handler for single endpoint
memen45 opened this issue · comments
memen45 commented
The following two example endpoints in JS use different middleware:
app.get(
'/api/endpoint1',
express.json(),
Routes.endpoint1_handler
);
app.post(
'/api/endpoint2',
express.raw({ type: "application/json" }),
Routes.endpoint2
);
I would like to achieve the same using the express-openapi-validator, however, it seems like only endpoint 1 is working. What should be added to the api.yml to make endpoint2 work as well?
I have tried to set the requestBody
schema for endpoint 2, but it still uses express.json().
Carmine DiMascio commented
This question is best for stack overflow. That said, both apis must be modeled within the oas spec. Include the expected content type and models