show an example of openapi in json
Sure, here's an example of an OpenAPI definition in JSON format:
{ "openapi": "3.0.0", "info": { "title": "Pet Store API", "version": "1.0.0", "description": "This is a sample server Petstore server", "termsOfService": "http://example.com/terms/" }, "servers": [ { "url": "https://petstore.example.com" } ], "paths": { "/pets": { "get": { "summary": "List all pets", "responses": { "200": { "description": "A list of pets", "content": { "application/json": { "schema": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "integer", "format": "int64" }, "name": { "type": "string" }, "tag": { "type": "string" } } } } } } } } } } } }
This example defines a simple Pet Store API with a single endpoint to get a list of pets. It includes information about the API version, the server URL, and the endpoint's operation, responses, and data schema.