OAS:OpenAPI Editor/Servers/Mock Server

From Remain Software

Mock Server

Our mock server is fully integrated, automated, and locally running within our studio. You don't have to configure anything.

It automatically validates the incoming payload following your OpenAPI definitions.

How it works

It automatically reads and keeps track of the OpenAPI model document you're working on. By doing so:

  • It automatically validates and handles the incoming payload for:
    • Paths
    • Request bodies
    • Parameters
    • Responses
  • It automatically builds needed data and calls back registered endpoints (callbacks), if any, as defined in your OpenAPI document.

Then generates a mock response based on the definitions in your OpenAPI document. if a schema provides an example, it's used in the response payload. Otherwise, a fairly realistic example is generated.

If a payload (or portion thereof) is invalid, an explanatory error response is sent back.

How to use it

To use this mock server in the web view, select the URL containing the path "/mockserver/" from the Servers dropdown. This mock-server URL can also be called/used elsewhere. E.g., Remain API Test, command line, or from within code.

Note: Most changes you're doing in your OpenAPI document are picked automatically by the mock-server, if you don't see your changes in the response payload, then just refresh your browser.


Openapi mock server.png


To run a test of all operations under a path against the mock server, right-click the path you want to test, select the Run menu, then from the servers dropdown, select the URL containing the path "/mockserver/" then click OK.


Openapi mock server run path.png