openapi: 3.1.0 info: title: Mocko Recipes Overview API version: '2026-10-21' description: 'GENERATED FROM DOCUMENTATION by API Evangelist on 2026-10-21: 16 operation(s) read from 7 public documentation page(s) (each operation names its page in x-source). This is not the provider''s published contract; Mocko has published no machine-readable contract that the pipeline could find. Engine: local.' x-evidence-tiers: code-example: 14 documentation: 16 pages-with-code: 15 pages-read: 20 x-generated-from: documentation x-provenance: generated x-authored-by: API Evangelist x-generated: '2026-10-21' x-generator: generate-contract-from-docs.py x-engine: local x-sources: - https://mocko.dev/docs/recipes/append-to-list - https://mocko.dev/docs/recipes/list-and-detail - https://mocko.dev/docs/recipes/microservices-by-host - https://mocko.dev/docs/recipes/mock-one-edge-case - https://mocko.dev/docs/recipes/polling-status - https://mocko.dev/docs/recipes/slow-unstable-apis - https://mocko.dev/docs/recipes/stateful-crud x-docs-section: recipes servers: - url: https://demo-api.mockoapp.net paths: /exports/{id}: get: operationId: get_exports_id tags: - Exports summary: Polling Status Flow x-source: https://mocko.dev/docs/recipes/polling-status parameters: - name: id in: path required: true schema: type: string responses: '200': description: Success (status as documented) content: application/json: schema: $ref: '#/components/schemas/GetExportsIdResponse' x-evidence: kind: documentation /exports/{id}/polls: delete: operationId: delete_exports_id_polls tags: - Exports summary: Polling Status Flow x-source: https://mocko.dev/docs/recipes/polling-status parameters: - name: id in: path required: true schema: type: string responses: '200': description: Success (status as documented) content: application/json: schema: $ref: '#/components/schemas/DeleteExportsIdPollsResponse' x-evidence: kind: documentation /invoices/{id}: get: operationId: get_invoices_id tags: - Invoices summary: Mock Microservices by Host x-source: https://mocko.dev/docs/recipes/microservices-by-host parameters: - name: id in: path required: true schema: type: string responses: '200': description: Success (status as documented) content: application/json: schema: $ref: '#/components/schemas/GetInvoicesIdResponse' x-evidence: kind: documentation /posts: get: operationId: get_posts tags: - Posts summary: GET /posts x-source: https://mocko.dev/docs/recipes/mock-one-edge-case parameters: - name: userId in: query required: false schema: type: string responses: '200': description: Success (status as documented) x-evidence: kind: code-example language: curl snippet: "curl 'http://localhost:8080/posts?userId=1' [] $ curl http://localhost:8080/posts [\n { \"id\": 1, \"userId\": 1, \"title\"\ : \"Getting started with mocking\" },\n { \"id\": 2, \"userId\": 2, \"title\": \"Designing good test data\" },\n { \"id\": 3, \"userId\"\ : 2, \"title\": \"Contract testing in practice\" }\n] How it works The mock owns the whole GET /posts route, but only the userId=1 branch\ \ renders a mocked response. Ever" /posts/{id}: get: operationId: get_posts_id tags: - Posts summary: Mock One Edge Case x-source: https://mocko.dev/docs/recipes/mock-one-edge-case parameters: - name: id in: path required: true schema: type: string responses: '200': description: Success (status as documented) x-evidence: kind: documentation /products: get: operationId: get_products tags: - Products summary: List and Detail From Data description: Returns a JSON array of all product objects defined in the data block. x-source: https://mocko.dev/docs/recipes/list-and-detail responses: '200': description: Success (status as documented) content: application/json: schema: $ref: '#/components/schemas/GetProductsResponse' x-evidence: kind: documentation /products/{id}: get: operationId: get_products_id tags: - Products summary: List and Detail From Data description: Returns the JSON payload of the product matching the given id, or a 404 error with an error message if not found. x-source: https://mocko.dev/docs/recipes/list-and-detail parameters: - name: id in: path required: true schema: type: string responses: '200': description: Success (status as documented) content: application/json: schema: $ref: '#/components/schemas/GetProductsIdResponse' x-evidence: kind: documentation /purchases: delete: operationId: delete_purchases tags: - Purchases summary: Append to a List x-source: https://mocko.dev/docs/recipes/append-to-list responses: '200': description: Success (status as documented) x-evidence: kind: documentation get: operationId: get_purchases tags: - Purchases summary: Append to a List x-source: https://mocko.dev/docs/recipes/append-to-list responses: '200': description: Success (status as documented) content: application/json: schema: $ref: '#/components/schemas/GetPurchasesResponse' x-evidence: kind: documentation post: operationId: post_purchases tags: - Purchases summary: POST /purchases x-source: https://mocko.dev/docs/recipes/append-to-list requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/PostPurchasesRequest' responses: '201': description: Success (status as documented) x-evidence: kind: code-example language: curl snippet: "curl -X POST http://localhost:8080/purchases -H 'Content-Type: application/json' -d '{\"product\": \"Widget\", \"qty\": 2}'\ \ {\n \"id\": \"7d4c2f2e-9b1a-4f7e-8a3d-5e6f7a8b9c0d\",\n \"status\": \"created\"\n} $ curl http://localhost:8080/purchases [\n { \"\ product\": \"Widget\", \"qty\": 2 }\n] How it works Every submission gets a fresh id from the uuid helper, and the whole request body\ \ is stored as an object under purchase" /reports/{id}: get: operationId: get_reports_id tags: - Reports summary: Simulate Slow or Unstable APIs description: The mock adds a 1‑second delay and makes roughly 30% of requests fail with a 500 error, otherwise proxies to the real backend. x-source: https://mocko.dev/docs/recipes/slow-unstable-apis parameters: - name: id in: path required: true schema: type: string responses: '200': description: Success (status as documented) x-evidence: kind: documentation /users: get: operationId: get_users tags: - Users summary: Stateful CRUD x-source: https://mocko.dev/docs/recipes/stateful-crud responses: '200': description: Success (status as documented) content: application/json: schema: $ref: '#/components/schemas/GetUsersResponse' x-evidence: kind: documentation post: operationId: post_users tags: - Users summary: POST /users x-source: https://mocko.dev/docs/recipes/stateful-crud requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/PostUsersRequest' responses: '201': description: Success (shape read from the example response on the page) content: application/json: schema: $ref: '#/components/schemas/PostUsersResponse' x-evidence: kind: code-example language: curl snippet: "curl -X POST http://localhost:8080/users -H 'Content-Type: application/json' -d '{\"name\": \"Alice\", \"email\": \"alice@example.com\"\ }' {\n \"id\": \"1c9e1e21-7a83-4d6e-9f42-2b2f6a3f8b0d\"\n} $ curl http://localhost:8080/users [\n { \"name\": \"Alice\", \"email\":\ \ \"alice@example.com\" }\n] Update with PUT , delete with DELETE (your generated id will differ), and the list and detail endpoints\ \ follow along, including a " /users/{id}: delete: operationId: delete_users_id tags: - Users summary: Stateful CRUD x-source: https://mocko.dev/docs/recipes/stateful-crud parameters: - name: id in: path required: true schema: type: string responses: '200': description: Success (status as documented) content: application/json: schema: $ref: '#/components/schemas/DeleteUsersIdResponse' x-evidence: kind: documentation get: operationId: get_users_id tags: - Users summary: Stateful CRUD x-source: https://mocko.dev/docs/recipes/stateful-crud parameters: - name: id in: path required: true schema: type: string responses: '200': description: Success (status as documented) content: application/json: schema: $ref: '#/components/schemas/GetUsersIdResponse' x-evidence: kind: documentation put: operationId: put_users_id tags: - Users summary: Stateful CRUD x-source: https://mocko.dev/docs/recipes/stateful-crud parameters: - name: id in: path required: true schema: type: string requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/PutUsersIdRequest' responses: '200': description: Success (status as documented) content: application/json: schema: $ref: '#/components/schemas/PutUsersIdResponse' x-evidence: kind: documentation components: schemas: GetExportsIdResponse: type: object properties: id: type: string description: The export identifier. status: type: string description: Current status of the export (e.g., "queued", "processing", "done"). url: type: string description: Download URL, present when status is "done". DeleteExportsIdPollsResponse: type: object properties: reset: type: boolean description: Indicates the poll counter was reset. GetInvoicesIdResponse: type: object properties: id: type: string description: The invoice identifier, echoed from the request status: type: string description: Fixed value "past_due" GetProductsResponse: type: object properties: '[]': type: array description: Array of product objects GetProductsIdResponse: type: object properties: id: type: integer description: Product identifier name: type: string description: Product name price: type: number description: Product price error: type: string description: Error message when product not found GetPurchasesResponse: type: object properties: product: type: string qty: type: integer PostPurchasesRequest: type: object properties: product: type: string qty: type: integer GetUsersResponse: type: object properties: '[]': type: array description: List of user objects. PostUsersRequest: type: object properties: name: type: string email: type: string PostUsersResponse: type: object properties: id: type: string name: type: string DeleteUsersIdResponse: type: object properties: deleted: type: boolean description: Indicates successful deletion. GetUsersIdResponse: type: object properties: user: type: object description: User object if found. error: type: string description: Error message when user not found (404). PutUsersIdRequest: type: object properties: body: type: object description: Updated user data. required: - body PutUsersIdResponse: type: object properties: user: type: object description: Updated user object. error: type: string description: Error message when user not found (404). securitySchemes: Bearer: type: http scheme: bearer x-source: https://mocko.dev/docs/sdk/auth tags: - name: Exports - name: Invoices - name: Posts - name: Products - name: Purchases - name: Reports - name: Users security: - Bearer: []