From c828c706cb4ec057f341627b172fbf7283bb00cd Mon Sep 17 00:00:00 2001 From: Brad Rydzewski Date: Sun, 17 May 2015 15:22:54 -0700 Subject: [PATCH] swagger API docs --- doc/swagger.json | 98 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 98 insertions(+) create mode 100644 doc/swagger.json diff --git a/doc/swagger.json b/doc/swagger.json new file mode 100644 index 000000000..fb1825bfe --- /dev/null +++ b/doc/swagger.json @@ -0,0 +1,98 @@ +{ + "swagger": "2.0", + "info": { + "version": "1.0.0", + "title": "Drone API", + "contact": { + "name": "Team Drone", + "url": "https://github.com/drone/drone" + }, + "license": { + "name": "Creative Commons 4.0 International", + "url": "http://creativecommons.org/licenses/by/4.0/" + } + }, + "host": "localhost:8080", + "basePath": "/api", + "schemes": [ + "http" + ], + "paths": { + "/user": { + "get": { + "description": "Returns the currently authenticated user.", + "produces": [ + "application/json" + ], + "responses": { + "200": { + "description": "The currently authenticated user.", + "schema": { + "$ref": "#/definitions/User" + } + } + } + }, + "patch": { + "description": "Updates the currently authenticated user.", + "produces": [ + "application/json" + ], + "parameters": [ + { + "name": "pet", + "in": "body", + "description": "Updates to the user.", + "required": true, + "schema": { + "$ref": "#/definitions/User" + } + } + ], + "responses": { + "200": { + "description": "The updated user.", + "schema": { + "$ref": "#/definitions/User" + } + } + } + } + } + }, + "definitions": { + "User": { + "required": [ + "login" + ], + "properties": { + "login": { + "type": "string" + }, + "name": { + "type": "string" + }, + "email": { + "type": "string" + }, + "gravatar_id": { + "type": "string" + }, + "admin": { + "type": "boolean" + }, + "active": { + "type": "boolean" + }, + "created_at": { + "type": "integer", + "format": "int64" + }, + "updated_at": { + "type": "integer", + "format": "int64" + } + } + } + } +}