UNPKG

boats

Version:

Beautiful Open / Async Template System - Write less yaml with BOATS and Nunjucks.

446 lines (445 loc) 15.3 kB
{ "openapi": "3.0.0", "info": { "version": "1.0.1", "title": "boats", "description": "A sample API", "contact": { "name": "Swagger API Team", "email": "john@boats.io", "url": "https://github.com/johndcarmichael/boats/" }, "license": { "name": "Apache 2.0", "url": "https://www.apache.org/licenses/LICENSE-2.0.html" } }, "servers": [ { "url": "localhost" } ], "tags": [ { "name": "weather", "description": "Weather data" } ], "paths": { "/weather": { "get": { "tags": [ "Weather" ], "summary": "weather data", "description": "Get the latest temperatures", "operationId": "weatherGet", "responses": { "200": { "description": "Successful fetch", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Weathers" } } } }, "404": { "description": "Temp not found" } } }, "post": { "tags": [ "Weather" ], "summary": "weather data", "description": "Create a new weather record.", "operationId": "weatherPost", "requestBody": { "description": "Optional description in *Markdown*", "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/WeatherPost" } } } }, "responses": { "200": { "description": "Successful temp creation", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Weather" } } } }, "422": { "description": "Invalid form data provided" } } } }, "/weather/id/{id}": { "get": { "tags": [ "Weather" ], "summary": "weather data", "description": "Get the latest temperatures", "operationId": "weatherIdIdGet", "parameters": [ { "$ref": "#/components/parameters/PathId" }, { "$ref": "#/components/parameters/QueryOffset" } ], "responses": { "200": { "description": "Successful fetch", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Weather" } } } }, "404": { "description": "Temp not found" } } }, "put": { "tags": [ "Weather" ], "summary": "weather data", "description": "Create a new weather record.", "operationId": "weatherIdIdPut", "parameters": [ { "$ref": "#/components/parameters/PathId" } ], "requestBody": { "description": "Optional description in *Markdown*", "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/WeatherPut" } } } }, "responses": { "200": { "description": "Successful temp creation", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Weather" } } } }, "422": { "description": "Invalid form data provided" } } } } }, "components": { "parameters": { "PathId": { "in": "path", "name": "id", "schema": { "type": "integer" }, "required": true, "description": "Numeric ID of object to fetch" }, "QueryOffset": { "in": "query", "name": "offset", "required": false, "schema": { "type": "integer", "minimum": 0 }, "description": "The number of items to skip before starting to collect the result set." } }, "schemas": { "GenericSearchMeta": { "properties": { "totalResultCount": { "type": "number" }, "offset": { "type": "number" }, "limit": { "type": "number" } } }, "LocationPatch": { "type": "object", "properties": { "name": { "type": "string" }, "coordinates": { "type": "array", "items": { "type": "string" } }, "description": { "type": "string" } } }, "LocationPicked": { "allOf": [ { "type": "object", "required": [ "name" ], "properties": { "name": { "type": "string" }, "description": { "type": "string" } } }, { "type": "object", "properties": { "id": { "type": "string" }, "location": { "allOf": [ { "type": "object", "required": [ "name" ], "properties": { "name": { "type": "string" }, "description": { "type": "string" } } } ] } } } ] }, "LocationPost": { "type": "object", "required": [ "name", "coordinates" ], "properties": { "name": { "type": "string" }, "coordinates": { "type": "array", "items": { "type": "string" } }, "description": { "type": "string" } } }, "LocationPut": { "allOf": [ { "type": "object", "properties": { "name": { "type": "string" }, "coordinates": { "type": "array", "items": { "type": "string" } }, "description": { "type": "string" } } }, { "type": "object", "properties": { "id": { "type": "string" }, "location": { "allOf": [ { "type": "object", "properties": { "name": { "type": "string" }, "coordinates": { "type": "array", "items": { "type": "string" } }, "description": { "type": "string" } } } ] } } } ] }, "WeatherDiscriminator": { "type": "object", "discriminator": { "mapping": { "typeOne": "#/components/schemas/WeatherPolymorphicmodelOne", "typeTwo": "#/components/schemas/WeatherPolymorphicmodelTwo" }, "propertyName": "selector" }, "oneOf": [ { "$ref": "#/components/schemas/WeatherPolymorphicmodelOne" }, { "$ref": "#/components/schemas/WeatherPolymorphicmodelTwo" } ] }, "Weather": { "type": "object", "properties": { "id": { "type": "integer" }, "date": { "type": "string", "format": "date" }, "location": { "type": "string" }, "cloudCoverPercentage": { "type": "integer" }, "humidityPercentage": { "type": "integer" }, "temperature": { "type": "number" } } }, "Weathers": { "type": "object", "properties": { "meta": { "$ref": "#/components/schemas/GenericSearchMeta" }, "data": { "type": "array", "items": { "$ref": "#/components/schemas/Weather" } } } }, "WeatherPolymorphicmodelOne": { "type": "object", "properties": { "id": { "type": "integer" }, "selector": { "type": "string" } } }, "WeatherPolymorphicmodelTwo": { "type": "object", "properties": { "body": { "type": "string" }, "selector": { "type": "string" } } }, "WeatherPost": { "type": "object", "properties": { "date": { "type": "string", "format": "date" }, "location": { "type": "string" }, "cloudCoverPercentage": { "type": "integer" }, "humidityPercentage": { "type": "integer" }, "temperature": { "type": "number" } } }, "WeatherPut": { "allOf": [ { "$ref": "#/components/schemas/WeatherPost" }, { "type": "object", "properties": { "id": { "type": "integer" } } } ] } } } }