Executive summary
PetStore Mock API is a small Boomi Web Services project that mimics two operations of the public Swagger Petstore: get a pet by ID and create a pet. It gives front-end and integration teams a stable endpoint to build against before the real back end exists.
It is also a clean reference for the layering used in larger projects: a thin listener process, a sub-process with the business logic, a JSON profile for the contract, and Petstore-style error responses.
Purpose
Unblock client teams
Front-end and mobile developers get a working Petstore-compatible API on day one.
Contract testing
Predictable responses — including errors — make it easy to test client error handling.
Reference pattern
Shows the API → [SUB] layering, regex decisions and Message-shape responses in their simplest form.
What it demonstrates
Web Services Server
Exposing Boomi processes as REST endpoints on the Atom Cloud shared web server.
Query parameters as DPPs
petId arrives as dynamic process property query_petId.
JSON profile
j.PetStore.Pet follows the Swagger Petstore Pet schema and is used for field access in decisions.
Input validation
Regex decisions reject bad IDs and missing names before anything else runs.
Consistent errors
Errors use the Petstore ApiResponse shape: code, type, message.
Observability
A Notify shape logs every accepted pet in the process log.
Solution architecture
API reference
Base URL: https://<atom-cloud>/ws/simple · Basic authentication with the Atom Cloud shared web server user.
| Boomi endpoint | Swagger Petstore | Process | Input → output |
|---|---|---|---|
GET /getPetstorePet?petId= | GET /pet/{petId} | PetStore API - Get Pet | none → single data |
POST /createPetstorePet | POST /pet | PetStore API - Create Pet | single JSON → single data |
Pet schema (profile j.PetStore.Pet)
| Field | Type | Description |
|---|---|---|
id | integer (int64) | Pet ID |
category | object {id, name} | Category |
name | string | Required — must contain at least one non-space character |
photoUrls | array of string | Photo URLs |
tags | array of {id, name} | Tags |
status | string | available | pending | sold |
Responses
| Case | HTTP | Body |
|---|---|---|
| GET with a numeric petId | 200 | Mock Pet “doggie” with the requested id |
| GET with a missing or non-numeric petId | 200 | {"code": 400, "type": "error", "message": "Invalid ID supplied"} |
| POST with a name | 200 | The request body, echoed back |
| POST without a usable name | 200 | {"code": 405, "type": "error", "message": "Invalid input: pet name is required"} |
type == "error" in the body.Examples
curl -u "$BOOMI_USER:$BOOMI_TOKEN" \ "https://<atom-cloud>/ws/simple/getPetstorePet?petId=123"
{ "id": 123, "category": {"id": 1, "name": "Dogs"}, "name": "doggie",
"photoUrls": ["https://petstore.swagger.io/photos/doggie.jpg"],
"tags": [{"id": 1, "name": "friendly"}], "status": "available" }curl -u "$BOOMI_USER:$BOOMI_TOKEN" -X POST -H "Content-Type: application/json" \
"https://<atom-cloud>/ws/simple/createPetstorePet" \
-d '{"id": 10, "name": "Bobby", "category": {"id": 1, "name": "Dogs"}, "status": "available"}'Process design
| Process | Shapes | Logic |
|---|---|---|
| PetStore API - Get Pet | Start (WSS Listen: PetStore WSS Get Pet) → Process Call → Return Documents | Receives GET, passes the request to the sub-process. |
| [SUB] PetStore Get Pet | Start (passthrough) → Decision “Valid Pet ID?” → Message → Return Documents | query_petId matches ^[0-9]+$ → mock Pet with that id; otherwise ApiResponse 400. |
| PetStore API - Create Pet | Start (WSS Listen: PetStore WSS Create Pet) → Process Call → Return Documents | Receives the JSON body, passes it to the sub-process. |
| [SUB] PetStore Create Pet | Start (passthrough) → Decision “Pet Name Provided?” → Notify / Message → Return Documents | name matches .*\S.* → Notify “Pet accepted: {1}” and echo the body; otherwise ApiResponse 405. |
Design decisions
- Thin listener, testable logic. The [SUB] processes use a passthrough start, so they can be run in Test Mode with a sample document — no HTTP call needed.
- Regex decisions keep validation explicit and visible on the canvas.
- Message shapes produce the exact Petstore JSON, so clients written for Swagger Petstore work unchanged.
- No persistence on purpose: the mock is stateless and safe to call repeatedly.
Test cases
| # | Request | Expected result |
|---|---|---|
| 1 | GET petId=123 | Pet doggie, id 123 |
| 2 | GET petId=abc | ApiResponse 400 |
| 3 | GET petId=-1 | ApiResponse 400 (minus sign is not a digit) |
| 4 | GET without petId | ApiResponse 400 |
| 5 | POST with name “Bobby” | Body echoed; “Pet accepted” in the process log |
| 6 | POST without name | ApiResponse 405 |
| 7 | POST with name of only spaces | ApiResponse 405 |
| 8 | POST with empty body | ApiResponse 405 |
All cases can be run interactively in the web console.
Web console mockup
A static console reproduces both endpoints in the browser with the same logic as the Boomi processes.
API Console
Build a GET or POST request, use presets for every test case, and read the body, headers, process log and cURL.
Execution path
The process diagram highlights the branch each request takes.
Pet Shop Demo
A tiny storefront that adds pets via POST and fetches them via GET.
API reference
Endpoints, schema, responses and cURL examples.
Request history
Every request in the session; click to replay.
Runs anywhere
Plain HTML, CSS and JavaScript on GitHub Pages; light and dark themes.
Components
| Type | Component | Purpose |
|---|---|---|
| Process (WSS) | PetStore API - Get Pet | Listener for GET getPetstorePet |
| Process (WSS) | PetStore API - Create Pet | Listener for POST createPetstorePet |
| Sub-process | [SUB] PetStore Get Pet | Validate petId, build the mock Pet |
| Sub-process | [SUB] PetStore Create Pet | Validate name, log and echo |
| Connector operation | PetStore WSS Get Pet | Web Services Server · GET · input none · output single data |
| Connector operation | PetStore WSS Create Pet | Web Services Server · CREATE · input single JSON · output single data |
| JSON profile | j.PetStore.Pet | Swagger Petstore Pet schema |
Repository layout
active-development/— Boomi component XML (processes, operations, profile).portal/— static web console mockup.docs/— this documentation (source indocs/_source/)..env.example— the settings needed to push and deploy; copy it to.env(never committed).
Setup & deployment
- Copy
.env.exampleto.envand fill in the Boomi account, API token, target folder, environment and test atom. - Push the components in
active-development/to the platform folder. - Deploy PetStore API - Get Pet and PetStore API - Create Pet to an Atom Cloud environment with the shared web server enabled.
- Call the endpoints with the shared web server user (Basic auth) and run the test cases above.
Limitations & next steps
Static GET data
GET always returns “doggie”; created pets are not stored.
HTTP status codes
Set the HTTP status (400/405) through the response headers so clients don’t need to inspect the body.
Persistence
Store pets in a database or Disk V2 and look them up by id.
More operations
Add PUT /pet, DELETE /pet/{petId} and findByStatus.
API Management
Publish through a Boomi API Service component with an OpenAPI spec.
Schema validation
Validate status against available | pending | sold and the types of every field.