Skip to content

Commit

Permalink
Add openrpc.json spec to example
Browse files Browse the repository at this point in the history
  • Loading branch information
nycholas committed Jul 10, 2024
1 parent 5ed872b commit 014eefa
Showing 1 changed file with 153 additions and 157 deletions.
310 changes: 153 additions & 157 deletions examples/openrpc/petstore-expanded-openrpc.json
Original file line number Diff line number Diff line change
@@ -1,182 +1,178 @@
{
"id": 1,
"jsonrpc": "2.0",
"result": {
"components": {
"schemas": {
"NewPet": {
"properties": {
"name": {
"type": "string"
},
"tag": {
"type": "string"
}
"components": {
"schemas": {
"NewPet": {
"properties": {
"name": {
"type": "string"
},
"required": [
"name"
],
"type": "object"
"tag": {
"type": "string"
}
},
"Pet": {
"allOf": [
{
"$ref": "#/components/schemas/NewPet"
"required": [
"name"
],
"type": "object"
},
"Pet": {
"allOf": [
{
"$ref": "#/components/schemas/NewPet"
},
{
"properties": {
"id": {
"type": "integer"
}
},
{
"properties": {
"id": {
"type": "integer"
}
},
"required": [
"id"
]
}
]
}
"required": [
"id"
]
}
]
}
}
},
"externalDocs": {
"url": "https://github.com/open-rpc/examples/blob/master/service-descriptions/petstore-expanded-openrpc.json"
},
"info": {
"contact": {
"email": "[email protected]",
"name": "OpenRPC Team",
"url": "https://open-rpc.org"
},
"externalDocs": {
"url": "https://github.com/open-rpc/examples/blob/master/service-descriptions/petstore-expanded-openrpc.json"
"description": "A sample API that uses a petstore as an example to demonstrate features in the OpenRPC specification",
"license": {
"name": "Apache 2.0",
"url": "https://www.apache.org/licenses/LICENSE-2.0.html"
},
"info": {
"contact": {
"email": "[email protected]",
"name": "OpenRPC Team",
"url": "https://open-rpc.org"
},
"description": "A sample API that uses a petstore as an example to demonstrate features in the OpenRPC specification",
"license": {
"name": "Apache 2.0",
"url": "https://www.apache.org/licenses/LICENSE-2.0.html"
},
"termsOfService": "https://open-rpc.org",
"title": "Petstore Expanded",
"version": "1.0.0"
},
"methods": [
{
"name": "rpc.describe",
"params": [],
"result": {
"name": "default",
"schema": {
"type": "object"
}
"termsOfService": "https://open-rpc.org",
"title": "Petstore Expanded",
"version": "1.0.0"
},
"methods": [
{
"name": "rpc.describe",
"params": [],
"result": {
"name": "default",
"schema": {
"type": "object"
}
},
{
"description": "Returns an OpenRPC schema as a description of this service",
"name": "rpc.discover",
"params": [],
"result": {
"name": "OpenRPC Schema",
"schema": {
"$ref": "https://raw.githubusercontent.com/open-rpc/meta-schema/master/schema.json"
}
}
},
{
"description": "Returns an OpenRPC schema as a description of this service",
"name": "rpc.discover",
"params": [],
"result": {
"name": "OpenRPC Schema",
"schema": {
"$ref": "https://raw.githubusercontent.com/open-rpc/meta-schema/master/schema.json"
}
},
{
"description": "Returns all pets from the system that the user has access to\nNam sed condimentum est. Maecenas tempor sagittis sapien, nec rhoncus sem sagittis sit amet. Aenean at gravida augue, ac iaculis sem. Curabitur odio lorem, ornare eget elementum nec, cursus id lectus. Duis mi turpis, pulvinar ac eros ac, tincidunt varius justo. In hac habitasse platea dictumst. Integer at adipiscing ante, a sagittis ligula. Aenean pharetra tempor ante molestie imperdiet. Vivamus id aliquam diam.",
"name": "Petstore.get_pets",
"params": [
{
"description": "tags to filter by",
"name": "tags",
"schema": {
"items": {
"type": "string"
},
"type": "array"
}
},
{
"description": "maximum number of results to return",
"name": "limit",
"schema": {
"type": "integer"
}
}
],
"result": {
"description": "pet response",
"name": "pet",
}
},
{
"description": "Returns all pets from the system that the user has access to\nNam sed condimentum est. Maecenas tempor sagittis sapien, nec rhoncus sem sagittis sit amet. Aenean at gravida augue, ac iaculis sem. Curabitur odio lorem, ornare eget elementum nec, cursus id lectus. Duis mi turpis, pulvinar ac eros ac, tincidunt varius justo. In hac habitasse platea dictumst. Integer at adipiscing ante, a sagittis ligula. Aenean pharetra tempor ante molestie imperdiet. Vivamus id aliquam diam.",
"name": "Petstore.get_pets",
"params": [
{
"description": "tags to filter by",
"name": "tags",
"schema": {
"items": {
"$ref": "#/components/schemas/Pet"
"type": "string"
},
"type": "array"
}
}
},
{
"description": "Creates a new pet in the store. Duplicates are allowed",
"name": "Petstore.create_pet",
"params": [
{
"description": "Pet to add to the store.",
"name": "newPet",
"schema": {
"$ref": "#/components/schemas/NewPet"
}
}
],
"result": {
"description": "the newly created pet",
"name": "pet",
},
{
"description": "maximum number of results to return",
"name": "limit",
"schema": {
"$ref": "#/components/schemas/Pet"
"type": "integer"
}
}
},
{
"description": "Returns a user based on a single ID, if the user does not have access to the pet",
"name": "Petstore.get_pet_by_id",
"params": [
{
"description": "ID of pet to fetch",
"name": "id",
"required": true,
"schema": {
"type": "integer"
}
}
],
"result": {
"description": "pet response",
"name": "pet",
"schema": {
],
"result": {
"description": "pet response",
"name": "pet",
"schema": {
"items": {
"$ref": "#/components/schemas/Pet"
},
"type": "array"
}
}
},
{
"description": "Creates a new pet in the store. Duplicates are allowed",
"name": "Petstore.create_pet",
"params": [
{
"description": "Pet to add to the store.",
"name": "newPet",
"schema": {
"$ref": "#/components/schemas/NewPet"
}
}
},
{
"description": "deletes a single pet based on the ID supplied",
"name": "Petstore.delete_pet_by_id",
"params": [
{
"description": "ID of pet to delete",
"name": "id",
"required": true,
"schema": {
"type": "integer"
}
],
"result": {
"description": "the newly created pet",
"name": "pet",
"schema": {
"$ref": "#/components/schemas/Pet"
}
}
},
{
"description": "Returns a user based on a single ID, if the user does not have access to the pet",
"name": "Petstore.get_pet_by_id",
"params": [
{
"description": "ID of pet to fetch",
"name": "id",
"required": true,
"schema": {
"type": "integer"
}
],
"result": {
"description": "pet deleted",
"name": "pet",
"schema": {}
}
],
"result": {
"description": "pet response",
"name": "pet",
"schema": {
"$ref": "#/components/schemas/Pet"
}
}
],
"openrpc": "1.0.0-rc1",
"servers": [
{
"name": "default",
"url": "http://petstore.open-rpc.org"
},
{
"description": "deletes a single pet based on the ID supplied",
"name": "Petstore.delete_pet_by_id",
"params": [
{
"description": "ID of pet to delete",
"name": "id",
"required": true,
"schema": {
"type": "integer"
}
}
],
"result": {
"description": "pet deleted",
"name": "pet",
"schema": {}
}
]
}
}
],
"openrpc": "1.0.0-rc1",
"servers": [
{
"name": "default",
"url": "http://petstore.open-rpc.org"
}
]
}

0 comments on commit 014eefa

Please sign in to comment.