boats
Version:
Beautiful Open / Async Template System - Write less yaml with BOATS and Nunjucks.
378 lines (377 loc) • 11.6 kB
JSON
{
"swagger": "2.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"
}
},
"host": "api.example.com",
"basePath": "/v1",
"schemes": [
"https"
],
"paths": {
"/v1/star-wars/": {
"get": {
"tags": [
"starWars"
],
"summary": "get star wars details",
"description": "get star wars details",
"operationId": "v1StarWarsGet",
"responses": {
"200": {
"description": "Successful fetch",
"schema": {
"$ref": "#/definitions/StarWars"
}
},
"404": {
"description": "Path & method combination not found"
}
}
}
},
"/weather": {
"get": {
"tags": [
"weather"
],
"summary": "weather search",
"description": "Search for weather objects",
"operationId": "v1WeatherGet",
"x-filename": "get",
"parameters": [
{
"$ref": "#/parameters/QueryOffset"
},
{
"$ref": "#/parameters/QueryTextSearch"
}
],
"responses": {
"200": {
"description": "Successful fetch",
"schema": {
"type": "object",
"properties": {
"meta": {
"$ref": "#/definitions/GenericSearchMeta"
},
"data": {
"type": "array",
"items": {
"$ref": "#/definitions/WeatherModel"
}
}
}
}
},
"404": {
"description": "Path & method combination not found"
}
}
}
},
"/weather/id/{id}": {
"get": {
"tags": [
"weather"
],
"summary": "One weather object",
"description": "Get the full weather object",
"operationId": "v1WeatherIdGet",
"produces": [
"application/json"
],
"parameters": [
{
"$ref": "#/parameters/PathId"
}
],
"responses": {
"200": {
"description": "Successful fetch",
"schema": {
"$ref": "#/definitions/WeatherModel"
}
},
"404": {
"description": "Path & method combination not found"
}
}
},
"delete": {
"tags": [
"weather"
],
"summary": "weather set to rain",
"description": "Reset awful sunny weather to excellent rainy weather",
"operationId": "v1WeatherIdDelete",
"x-filename": "delete",
"parameters": [
{
"$ref": "#/parameters/PathId"
},
{
"$ref": "#/parameters/QueryOffset"
},
{
"$ref": "#/parameters/QueryTextSearch"
},
{
"in": "query",
"name": "areYouSure",
"required": true,
"type": "string"
},
{
"in": "query",
"name": "areYouSureSure",
"required": true,
"type": "string"
}
],
"responses": {
"200": {
"description": "Deleted"
},
"404": {
"description": "Temp not found"
}
}
}
},
"/weather/id/{id}/pattern": {
"get": {
"tags": [
"weather"
],
"summary": "One weather object",
"description": "Get the full weather object",
"operationId": "v1WeatherIdPatternGet",
"produces": [
"application/json"
],
"parameters": [
{
"$ref": "#/parameters/PathId"
}
],
"responses": {
"200": {
"description": "Successful fetch",
"schema": {
"$ref": "#/definitions/WeatherModel"
}
},
"404": {
"description": "Path & method combination not found"
}
}
}
},
"/weather/latest": {
"get": {
"tags": [
"weather"
],
"summary": "lastest weather data",
"description": "Get the latest temperatures",
"operationId": "v1WeatherLatestGet",
"produces": [
"application/json"
],
"responses": {
"200": {
"description": "Successful fetch",
"schema": {
"$ref": "#/definitions/WeatherModels"
}
},
"404": {
"description": "Temp not found"
}
}
}
}
},
"parameters": {
"HeaderSearchId": {
"in": "header",
"name": "Search-Id",
"type": "string",
"description": "Unique search {id}",
"x-example": "569eecd9-9962-4aed-a0f0-30476c6a82ed"
},
"PathId": {
"in": "path",
"name": "id",
"type": "integer",
"required": true,
"description": "Numeric ID of object to fetch"
},
"QueryOffset": {
"in": "query",
"name": "offset",
"required": false,
"type": "integer",
"description": "The number of items to skip before starting to collect the result set."
},
"QueryTextSearch": {
"in": "query",
"name": "textSearch",
"required": false,
"type": "string",
"description": "Search string to query"
}
},
"definitions": {
"GenericSearchMeta": {
"type": "object",
"properties": {
"totalResultCount": {
"type": "number"
},
"offset": {
"type": "number"
},
"limit": {
"type": "number"
}
}
},
"LocationPatch": {
"type": "object",
"properties": {
"name": {
"type": "string"
},
"coordinates": {
"type": "array",
"items": {
"type": "string"
}
}
}
},
"LocationPost": {
"type": "object",
"required": [
"name",
"coordinates"
],
"properties": {
"name": {
"type": "string"
},
"coordinates": {
"type": "array",
"items": {
"type": "string"
}
}
}
},
"LocationPut": {
"type": "object",
"required": [
"name"
],
"properties": {
"name": {
"type": "string"
}
}
},
"StarWars": {
"type": "object",
"properties": {
"empireName": {
"type": "string"
},
"rebellious": {
"type": "boolean"
},
"darthVader": {
"type": "boolean"
}
}
},
"WeatherIdPut": {
"allOf": [
{
"$ref": "#/definitions/WeatherPost"
},
{
"type": "object",
"properties": {
"id": {
"type": "integer"
}
}
}
]
},
"WeatherModel": {
"type": "object",
"properties": {
"id": {
"type": "integer"
},
"date": {
"type": "string",
"format": "date"
},
"location": {
"type": "string"
},
"cloudCoverPercentage": {
"type": "integer"
},
"humidityPercentage": {
"type": "integer"
},
"temperature": {
"type": "number"
}
}
},
"WeatherModels": {
"type": "array",
"items": {
"$ref": "#/definitions/WeatherModel"
}
},
"WeatherPost": {
"type": "object",
"properties": {
"date": {
"type": "string",
"format": "date"
},
"location": {
"type": "string"
},
"cloudCoverPercentage": {
"type": "integer"
},
"humidityPercentage": {
"type": "integer"
},
"temperature": {
"type": "number"
}
}
}
}
}