smocker-dev / smocker

Smocker is a simple and efficient HTTP mock server and proxy
https://smocker.dev
MIT License
1.14k stars 61 forks source link

API - ability to reset individual mocks without lock/unlock #259

Open coryjquirk opened 2 years ago

coryjquirk commented 2 years ago

I'm currently working on an implementation of the Smocker mock server. Thank you for the lovely project that is built so far.

At this time with POST /reset, it seems the only available method to clear an individual mock with an API call is to:

  1. Lock all other mocks besides the one to be cleared
  2. Call POST /reset to clear the singular unlocked mock

Potential feature: Pass in a list of mock IDs as the body for a call to POST /reset to specify which mocks should be cleared. This clears the mock and history of calls associated with specified mock(s).

This could perhaps be implemented similar to how we can pass in a list of mock IDs as a body with POST /mocks/lock and POST /mocks/unlock.

My apologies if this potential feature idea has already been addressed elsewhere. If that's the case, please redirect me to where this work is already being done. I intend on attempting to contribute code for this feature, although I'm new to writing in Go.