Quick-Start Guide
This quick-start guide will show how to make a simple pet store which returns a pet by name. If no pets are found, it will return a custom message.
- Deploy the components using Docker to start up the designer and server.
- Navigate to the Designer (http://localhost:4200) in your browser.
- Download petstore.json or use your own sample OpenAPI file.
-
Click “Create new Mock” and fill out the form to create a new mockdefinition.
-
Edit the GET
/pets
endpoint to provide a non-empty response.a. Click on the GET
/pets
endpoint, then click on “Default OK Scenario”b. Click on the “Response” tab and set the Response Body to
{"pets":[{"name":"sherlock"}]}
then click “Save”. -
Activate the completed mock definition by Exporting it to the server.
Click on “Export Mock to Server” in the left side menu.
The default server url is http://localhost:5000/api/v1/OrbitalAdmin. Select the mockdefinition that you've created and click the right arrow
>
to move it to the right-hand side, then click “Upload”. If there is an error, ensure that the server is running by accessing http://localhost:5000 in your browser; if it’s not running, refer to the Installation Instructions to set it up. - Test the deployment of the mock definition by submitting requests to the mock server.
- Navigate to http://localhost:5000/pets in your browser. It should display
{"pets":[{"name":"sherlock"}]}
, which was configured above. - Navigate to http://localhost:5000/pets/sherlock in your browser. It should display
{}
since no response was configured.
- Navigate to http://localhost:5000/pets in your browser. It should display
Congratulations! You have created your very first Orbital Mock. Feel free to edit the example or use a different OpenAPI spec to match different types of requests.
If you want to learn more about scenarios, policies, or different rule matching with header rules, query rules, URL rules and body rules.