Skip to main content
This guide builds one complete service with OpenAPI. You will verify an operation, register the service, start its HTTP endpoint, and run an application test against it. Install Simile first, then confirm the binary is ready:
See Downloads when Simile is not installed yet.

1. Write the public contract

Create orders.yaml:
The extension makes product and quantity hard request-to-response postconditions. Simile may generate the order ID, while the response must preserve the values supplied by the caller.

2. Compose the service

Create Simfile beside the contract:
The contract owns the HTTP surface. The Simfile names the runnable service, selects its contract, and sets its local listener.

3. Verify one operation

Describe the assembled service, then execute createOrder directly:
run validates the request, constructs a reachable response, proves the declared relation, and prints the response payload. Add --verbose to see the normalized request, selected outcome, and response metadata.

4. Register and start

Registration compiles the service into an immutable local revision:
Keep the server running. In another terminal, call it as an ordinary HTTP service:
One response may look like:
Generated values vary between new requests. Idempotency and resource identity can make repeated calls replay the first committed result when the contract supports those identities.

5. Run an application test

Let Simile own the emulator’s lifetime during a test:
Simile starts the service on an available port, exports that address as SIMILE_BASE_URL, runs the test command, returns its exit status, and shuts the service down.

Continue