mock-server / mockserver

MockServer enables easy mocking of any system you integrate with via HTTP or HTTPS with clients written in Java, JavaScript and Ruby. MockServer also includes a proxy that introspects all proxied traffic including encrypted SSL traffic and supports Port Forwarding, Web Proxying (i.e. HTTP proxy), HTTPS Tunneling Proxying (using HTTP CONNECT) and SOCKS Proxying (i.e. dynamic port forwarding).
http://mock-server.com
Apache License 2.0
4.52k stars 1.06k forks source link

Extract current Expectations via API #1850

Open JoaoGFarias opened 4 months ago

JoaoGFarias commented 4 months ago

Describe the feature request To have a GET endpoint in MockServer's API that returns in its payload a list of all Expecations currently existing in a MockServer instance.

What you are trying to do Currently, MockServer's API allows the user to introduce Expectations to a MockServer instance.

image

However, a feature that could useful for teams is to allow user to fetch all existing Expecations in a MockServer.

This can be specially useful for those who deal with MockServer programatically, where the set up of MockServer in a particular state can be difficult without the code that makes the setup.

With this, people could share JSON files that can be used to setup other MockServer instances (via the PUT endpoint mentioned above), allowing exploratory testing sessions in a particularly complex Expectation setup, without having to run code that creates this setup programatically.

Describe alternatives you've considered We could have a button on the UI that downloads a JSON file that represents all Expectations.