kogosoftwarellc / open-api

A Monorepo of various packages to power OpenAPI in node
MIT License
892 stars 235 forks source link

Is it possible to configure express-openapi to reject (404) routes without any apiDoc? #788

Open marcjordan opened 2 years ago

marcjordan commented 2 years ago

Looking at this test: https://github.com/kogosoftwarellc/open-api/tree/master/packages/openapi-framework/test/sample-projects/paths-dir-with-no-method-doc

This implies that if I don't declare any apiDoc on the handler, and I don't put anything in the paths section of the top-level doc for a path, express will route to the handler it discovers with fs-routes. Is there a way I can configure it to return a 404 (or some other error) in this case?