Skip to content

Instantly share code, notes, and snippets.

@heldersepu
Last active March 27, 2018 22:42
Show Gist options
  • Save heldersepu/c20f1e023339e21eafb92ae4307b0422 to your computer and use it in GitHub Desktop.
Save heldersepu/c20f1e023339e21eafb92ae4307b0422 to your computer and use it in GitHub Desktop.
{
"swagger": "2.0",
"info": {
"description": "API Docs",
"version": "1.0.0",
"title": "API",
"termsOfService": "none",
"contact": {
"email": "admin@localhost"
},
"license": {
"name": "Apache 2.0",
"url": "http://www.apache.org/licenses/LICENSE-2.0.html"
}
},
"host": "localhost:9999",
"tags": [
{
"name": "auth",
"description": "Auth related endpoints"
}
],
"schemes": [
"http"
],
"externalDocs": {
"description": "GeoJSON docs",
"url": "http://geojson.org/"
},
"paths": {
"/api/auth_token": {
"post": {
"tags": [
"auth"
],
"summary": "Obtain auth token",
"description": "Le description",
"operationId": "getAuthToken",
"consumes": ["application/json", "application/xml"],
"produces": ["application/json"],
"parameters": [
{
"in": "body",
"name": "",
"description": "User credentials",
"required": true,
"schema": {
"$ref": "#/definitions/Credentials"
}
}
],
"responses": {
"200": {
"description": "Invalid ID supplied",
"schema": {
"$ref": "#/definitions/JWT"
}
},
"401": {
"description": "Email & password does not match"
},
"404": {
"description": "User not found"
}
}
}
}
},
"definitions": {
"Credentials": {
"type": "object",
"properties": {
"email": {
"type": "string",
"description": "User E-mail"
},
"password": {
"type": "string",
"description": "User password"
}
}
},
"JWT": {
"type": "object",
"properties": {
"token": {
"type": "string"
}
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment