Closed penx closed 6 years ago
My guess, after reading:
Is to set defaultPipe: swagger_controllers
in config/default.yaml
and then update the following:
To handle controllerName
being undefined
and proceed to set up a mock.
I've created an example project here that works against my proposed fix https://github.com/penx/openapi-mock/tree/initial-example
As far as I'm aware, in order to enable a mock for a path, I either need to:
x-swagger-router-controller
on the path in the yaml/json specx-swagger-router-controller
on the operation (not sure how to do this)I think there may also be a way to enable mocks using
x-swagger-pipe
on the path/operation too?Not doing the above results in:
It would be good to have a way to enable mocks on all paths without having to edit the yaml spec file, e.g. you are provided with a spec and want to quickly fire up a 100% mock of it.
Is there a config setting to do this? If not, is it a reasonable feature request? I may be able to work on this if so - any pointers on how this should be done?