Skip to content

Option to enable mocks for all paths by default #118

Closed
@penx

Description

@penx

As far as I'm aware, in order to enable a mock for a path, I either need to:

  • set x-swagger-router-controller on the path in the yaml/json spec
  • set x-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:

Error: No implementation found for this path.
at api-swagger/node_modules/swagger-node-runner/lib/connect_middleware.js:50:21

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions