Created
September 12, 2023 13:50
-
-
Save doitian/25c2d3892708f90a5a137f1eca44f32f to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"openrpc": "1.0.0-rc1", | |
"info": { | |
"version": "1.0.0", | |
"title": "Petstore", | |
"license": { | |
"name": "MIT" | |
} | |
}, | |
"servers": [ | |
{ | |
"url": "http://localhost:8080" | |
} | |
], | |
"methods": [ | |
{ | |
"name": "list_pets", | |
"summary": "List all pets", | |
"tags": [ | |
{ | |
"name": "pets" | |
} | |
], | |
"params": [ | |
{ | |
"name": "limit", | |
"description": "How many items to return at one time (max 100)", | |
"required": false, | |
"schema": { | |
"type": "integer", | |
"minimum": 1 | |
} | |
} | |
], | |
"result": { | |
"name": "pets", | |
"description": "A paged array of pets", | |
"schema": { | |
"$ref": "#/components/schemas/Pets" | |
} | |
}, | |
"errors": [ | |
{ | |
"code": 100, | |
"message": "pets busy" | |
} | |
], | |
"examples": [ | |
{ | |
"name": "listPetExample", | |
"description": "List pet example", | |
"params": [ | |
{ | |
"name": "limit", | |
"value": 1 | |
} | |
], | |
"result": { | |
"name": "listPetResultExample", | |
"value": [ | |
{ | |
"id": 7, | |
"name": "fluffy", | |
"tag": "poodle" | |
} | |
] | |
} | |
} | |
] | |
}, | |
{ | |
"name": "create_pet", | |
"summary": "Create a pet", | |
"tags": [ | |
{ | |
"name": "pets" | |
} | |
], | |
"params": [ | |
{ | |
"name": "newPetName", | |
"description": "Name of pet to create", | |
"required": true, | |
"schema": { | |
"type": "string" | |
} | |
}, | |
{ | |
"name": "newPetTag", | |
"description": "Pet tag to create", | |
"schema": { | |
"type": "string" | |
} | |
} | |
], | |
"examples": [ | |
{ | |
"name": "createPetExample", | |
"description": "Create pet example", | |
"params": [ | |
{ | |
"name": "newPetName", | |
"value": "fluffy" | |
}, | |
{ | |
"name": "tag", | |
"value": "poodle" | |
} | |
], | |
"result": { | |
"name": "listPetResultExample", | |
"value": 7 | |
} | |
} | |
], | |
"result": { | |
"$ref": "#/components/contentDescriptors/PetId" | |
} | |
}, | |
{ | |
"name": "get_pet", | |
"summary": "Info for a specific pet", | |
"tags": [ | |
{ | |
"name": "pets" | |
} | |
], | |
"params": [ | |
{ | |
"$ref": "#/components/contentDescriptors/PetId" | |
} | |
], | |
"result": { | |
"name": "pet", | |
"description": "Expected response to a valid request", | |
"schema": { | |
"$ref": "#/components/schemas/Pet" | |
} | |
}, | |
"examples": [ | |
{ | |
"name": "getPetExample", | |
"description": "get pet example", | |
"params": [ | |
{ | |
"name": "petId", | |
"value": 7 | |
} | |
], | |
"result": { | |
"name": "getPetExampleResult", | |
"value": { | |
"name": "fluffy", | |
"tag": "poodle", | |
"id": 7 | |
} | |
} | |
} | |
] | |
} | |
], | |
"components": { | |
"contentDescriptors": { | |
"PetId": { | |
"name": "petId", | |
"required": true, | |
"description": "The id of the pet to retrieve", | |
"schema": { | |
"$ref": "#/components/schemas/PetId" | |
} | |
} | |
}, | |
"schemas": { | |
"PetId": { | |
"type": "integer", | |
"minimum": 0 | |
}, | |
"Pet": { | |
"type": "object", | |
"required": [ | |
"id", | |
"name" | |
], | |
"properties": { | |
"id": { | |
"$ref": "#/components/schemas/PetId" | |
}, | |
"name": { | |
"type": "string" | |
}, | |
"tag": { | |
"type": "string" | |
} | |
} | |
}, | |
"Pets": { | |
"type": "array", | |
"items": { | |
"$ref": "#/components/schemas/Pet" | |
} | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment