test-app/swagger/v1/swagger.json
{
"openapi": "3.0.0",
"info": {
"title": "API V1",
"version": "v1"
},
"paths": {
"/auth-tests/basic": {
"post": {
"summary": "Authenticates with basic auth",
"tags": [
"Auth Tests"
],
"operationId": "testBasicAuth",
"security": [
{
"basic_auth": [
]
}
],
"responses": {
"204": {
"description": "Valid credentials"
},
"401": {
"description": "Invalid credentials"
}
}
}
},
"/auth-tests/api-key": {
"post": {
"summary": "Authenticates with an api key",
"tags": [
"Auth Tests"
],
"operationId": "testApiKey",
"security": [
{
"api_key": [
]
}
],
"responses": {
"204": {
"description": "Valid credentials"
},
"401": {
"description": "Invalid credentials"
}
}
}
},
"/auth-tests/basic-and-api-key": {
"post": {
"summary": "Authenticates with basic auth and api key",
"tags": [
"Auth Tests"
],
"operationId": "testBasicAndApiKey",
"security": [
{
"basic_auth": [
],
"api_key": [
]
}
],
"responses": {
"204": {
"description": "Valid credentials"
},
"401": {
"description": "Invalid credentials"
}
}
}
},
"/blogs": {
"post": {
"summary": "Creates a blog",
"tags": [
"Blogs"
],
"description": "Creates a new blog from provided data",
"operationId": "createBlog",
"parameters": [
],
"responses": {
"201": {
"description": "blog created"
},
"422": {
"description": "invalid request",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/errors_object"
}
}
}
}
},
"requestBody": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/blog"
}
}
}
}
},
"get": {
"summary": "Searches blogs",
"tags": [
"Blogs"
],
"description": "Searches blogs by keywords",
"operationId": "searchBlogs",
"parameters": [
{
"name": "keywords",
"in": "query",
"schema": {
"type": "string"
}
},
{
"name": "status",
"in": "query",
"schema": {
"type": "string"
}
}
],
"responses": {
"200": {
"description": "no content",
"content": {
"application/json": {
"schema": {
"type": "array",
"items": {
"$ref": "#/components/schemas/blog"
}
}
}
}
},
"406": {
"description": "unsupported accept header"
}
}
}
},
"/blogs/flexible": {
"post": {
"summary": "Creates a blog flexible body",
"tags": [
"Blogs"
],
"description": "Creates a flexible blog from provided data",
"operationId": "createFlexibleBlog",
"parameters": [
],
"responses": {
"201": {
"description": "flexible blog created",
"content": {
"application/json": {
"schema": {
"oneOf": [
{
"$ref": "#/components/schemas/blog"
},
{
"$ref": "#/components/schemas/flexible_blog"
}
]
}
}
}
}
},
"requestBody": {
"content": {
"application/json": {
"schema": {
"oneOf": [
{
"$ref": "#/definitions/blog"
},
{
"$ref": "#/definitions/flexible_blog"
}
]
}
}
}
}
}
},
"/blogs/{id}": {
"parameters": [
{
"name": "id",
"in": "path",
"required": true,
"schema": {
"type": "string"
}
}
],
"get": {
"summary": "Retrieves a blog",
"tags": [
"Blogs"
],
"description": "Retrieves a specific blog by id",
"operationId": "getBlog",
"responses": {
"200": {
"description": "blog found - openapi_strict_schema_validation = true",
"headers": {
"ETag": {
"type": "string"
},
"Last-Modified": {
"type": "string"
},
"Cache-Control": {
"type": "string"
}
},
"content": {
"application/json": {
"examples": {
"example_0": {
"value": {
"id": 1,
"title": "Hello legacy world!",
"content": "Hello legacy world and hello universe. Thank you all very much!!!",
"thumbnail": "legacy-thumbnail.png"
}
},
"blog_example_1": {
"value": {
"id": 1,
"title": "Hello world!",
"content": "Hello world and hello universe. Thank you all very much!!!",
"thumbnail": "thumbnail.png"
},
"summary": "Summary of the example",
"description": "A longer description of a fine blog post about a wonderful universe!"
},
"blog_example_2": {
"value": {
"id": 1,
"title": "Another fine example!",
"content": "Oh... what a fine example this is, indeed, a fine example!",
"thumbnail": "thumbnail.png"
}
}
},
"schema": {
"$ref": "#/components/schemas/blog"
}
}
}
},
"404": {
"description": "blog not found"
}
}
}
},
"/blogs/{id}/upload": {
"parameters": [
{
"name": "id",
"in": "path",
"required": true,
"schema": {
"type": "string"
}
}
],
"put": {
"summary": "Uploads a blog thumbnail",
"tags": [
"Blogs"
],
"description": "Upload a thumbnail for specific blog by id",
"operationId": "uploadThumbnailBlog",
"parameters": [
],
"responses": {
"200": {
"description": "blog updated"
}
},
"requestBody": {
"content": {
"multipart/form-data": {
"schema": {
"type": "file"
}
}
},
"required": true,
"description": "The content of the blog thumbnail"
}
}
}
},
"servers": [
{
"url": "{protocol}://{defaultHost}",
"variables": {
"protocol": {
"default": "https"
},
"defaultHost": {
"default": "www.example.com"
}
}
}
],
"components": {
"securitySchemes": {
"basic_auth": {
"type": "http",
"scheme": "basic"
},
"api_key": {
"type": "apiKey",
"name": "api_key",
"in": "query"
}
},
"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",
"x-nullable": true
},
"thumbnail": {
"type": "string",
"x-nullable": true
}
},
"required": [
"id",
"title"
]
},
"flexible_blog": {
"type": "object",
"properties": {
"id": {
"type": "integer"
},
"headline": {
"type": "string"
},
"text": {
"type": "string",
"nullable": true
},
"thumbnail": {
"type": "string",
"nullable": true
}
},
"required": [
"id",
"headline"
]
}
}
}
}