{"openapi":"3.0.3","info":{"title":"Petstore","version":"1.0.0","description":"Built-in sample for Rustybin mocks. Every operation answers from the examples below (or generated data), `GET /pets/0` answers 404 through a rule, and switching security on protects the write operations with an API key or a bearer token."},"servers":[{"url":"https://demo.rustybin.dev/mock/petstore/v1","description":"Rustybin mock \"petstore\""}],"tags":[{"name":"pets","description":"Everything about pets"},{"name":"store","description":"Orders"}],"paths":{"/pets":{"get":{"tags":["pets"],"operationId":"listPets","summary":"List pets","parameters":[{"name":"limit","in":"query","description":"How many pets to return (at most 100)","schema":{"type":"integer","minimum":1,"maximum":100,"default":20}},{"name":"status","in":"query","schema":{"$ref":"#/components/schemas/PetStatus"}}],"responses":{"200":{"description":"A page of pets","headers":{"X-Total-Count":{"schema":{"type":"integer","example":3}}},"content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Pet"}},"examples":{"three":{"summary":"Three pets","value":[{"id":1,"name":"Rex","tag":"dog","status":"available"},{"id":2,"name":"Tom","tag":"cat","status":"pending"},{"id":3,"name":"Polly","tag":"parrot","status":"sold"}]}}}}}}},"post":{"tags":["pets"],"operationId":"createPet","summary":"Add a pet","security":[{"apiKey":[]},{"bearer":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/NewPet"},"example":{"name":"Rex","tag":"dog"}}}},"responses":{"201":{"description":"Created","headers":{"Location":{"schema":{"type":"string","example":"/v1/pets/4"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Pet"},"example":{"id":4,"name":"Rex","tag":"dog","status":"available"}}}},"422":{"description":"Invalid pet","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":422,"message":"name is required"}}}}}}},"/pets/{petId}":{"parameters":[{"name":"petId","in":"path","required":true,"description":"Pet id (0 answers 404)","schema":{"type":"integer","format":"int64","minimum":0}}],"get":{"tags":["pets"],"operationId":"getPetById","summary":"Find a pet by id","responses":{"200":{"description":"The pet","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Pet"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"examples":{"notFound":{"value":{"code":404,"message":"pet not found"}}}}}}}},"put":{"tags":["pets"],"operationId":"updatePet","summary":"Update a pet","security":[{"apiKey":[]},{"bearer":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/NewPet"}}}},"responses":{"200":{"description":"Updated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Pet"}}}}}},"delete":{"tags":["pets"],"operationId":"deletePet","summary":"Delete a pet","security":[{"apiKey":[]},{"bearer":[]}],"responses":{"204":{"description":"Deleted"}}}},"/store/orders":{"post":{"tags":["store"],"operationId":"placeOrder","summary":"Order a pet","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Order"}}}},"responses":{"201":{"description":"Order placed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Order"}}}}}}}},"components":{"securitySchemes":{"apiKey":{"type":"apiKey","in":"header","name":"X-API-Key"},"bearer":{"type":"http","scheme":"bearer","bearerFormat":"JWT"}},"schemas":{"PetStatus":{"type":"string","enum":["available","pending","sold"]},"NewPet":{"type":"object","required":["name"],"properties":{"name":{"type":"string","minLength":1,"maxLength":64,"example":"Rex"},"tag":{"type":"string","example":"dog"}}},"Pet":{"allOf":[{"$ref":"#/components/schemas/NewPet"},{"type":"object","required":["id","status"],"properties":{"id":{"type":"integer","format":"int64","readOnly":true},"status":{"$ref":"#/components/schemas/PetStatus"}}}]},"Order":{"type":"object","required":["petId","quantity"],"properties":{"id":{"type":"string","format":"uuid","readOnly":true},"petId":{"type":"integer","format":"int64"},"quantity":{"type":"integer","minimum":1,"maximum":10},"shipDate":{"type":"string","format":"date-time"},"status":{"type":"string","enum":["placed","approved","delivered"],"readOnly":true}}},"Error":{"type":"object","required":["code","message"],"properties":{"code":{"type":"integer"},"message":{"type":"string"}}}}},"x-rustybin-mcp":{"url":"https://demo.rustybin.dev/mock/petstore/_rustybin/mcp"}}