sway-connect icon indicating copy to clipboard operation
sway-connect copied to clipboard

Design the mock middleware

Open whitlockjc opened this issue 9 years ago • 0 comments

The swagger-router middleware in swagger-tools not only did routing but it also is where the mocking support in swagger-tools was written. The original idea behind this decision was this: If there is a route handler, use it, otherwise allow swagger-router to send a mock if mocks are enabled. Maybe we'll end up back there but as of right now, I think mocking should be its own thing.

The whole idea of this middleware is to generate a mock response based on the matched Swagger request. It seems pretty simple but if you have any suggestions, I'm all ears.

whitlockjc avatar Feb 14 '16 06:02 whitlockjc