{ "openapi": "3.0.0", "info": { "title": "API V1", "version": "v1" }, "paths": { "/blogs": { "post": { "summary": "Creates a blog", "tags": [ "Blogs" ], "description": "Creates a new blog from provided data", "operationId": "createBlog", "consumes": [ "application/json" ], "produces": [ "application/json" ], "requestBody": { "required": true, "content": { "application/json": { "examples": { "blog": { "value": { "blog": { "title": "foo", "content": "bar" } } } } } } }, "parameters": [ ], "responses": { "201": { "description": "blog created", "content": { "application/json": { "example": { "id": 1, "title": "foo", "content": "bar", "thumbnail": null } } } }, "422": { "description": "invalid request", "schema": { "$ref": "#/components/schemas/errors_object" }, "content": { "application/json": { "example": { "errors": { "content": [ "can't be blank" ] } } } } } } }, "get": { "summary": "Searches blogs", "tags": [ "Blogs" ], "description": "Searches blogs by keywords", "operationId": "searchBlogs", "produces": [ "application/json" ], "parameters": [ { "name": "keywords", "in": "query", "type": "string" } ], "responses": { "406": { "description": "unsupported accept header" } } } } }, "servers": [ { "url": "https://{defaultHost}", "variables": { "defaultHost": { "default": "www.example.com" } } } ], "components": { "schemas": { "errors_object": { "type": "object", "properties": { "errors": { "$ref": "#/components/schemas/errors_map" } } }, "errors_map": { "type": "object", "additionalProperties": { "type": "array", "items": { "type": "string" } } }, "blog": { "type": "object", "properties": { "id": { "type": "integer" }, "title": { "type": "string" }, "content": { "type": "string", "nullable": true }, "thumbnail": { "type": "string" } }, "required": [ "id", "title", "content", "thumbnail" ] } }, "securitySchemes": { "basic_auth": { "type": "http", "scheme": "basic" }, "api_key": { "type": "apiKey", "name": "api_key", "in": "query" } } } }