Last active
January 24, 2016 14:33
-
-
Save jkarni/a33dd150ac998e586f87 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"paths": { | |
"/user/{username}": { | |
"put": { | |
"parameters": [ | |
{ | |
"type": "string", | |
"name": "username", | |
"in": "path", | |
"required": true | |
}, | |
{ | |
"name": "body", | |
"in": "body", | |
"schema": { | |
"$ref": "#/definitions/User" | |
} | |
} | |
], | |
"produces": [ | |
"application/json" | |
], | |
"responses": { | |
"204": { | |
"description": "" | |
}, | |
"400": { | |
"description": "Invalid body" | |
}, | |
"404": { | |
"description": "username not found" | |
} | |
}, | |
"consumes": [ | |
"application/json" | |
] | |
}, | |
"delete": { | |
"parameters": [ | |
{ | |
"type": "string", | |
"name": "username", | |
"in": "path", | |
"required": true | |
} | |
], | |
"produces": [ | |
"application/json" | |
], | |
"responses": { | |
"204": { | |
"description": "" | |
}, | |
"404": { | |
"description": "username not found" | |
} | |
} | |
}, | |
"get": { | |
"parameters": [ | |
{ | |
"type": "string", | |
"name": "username", | |
"in": "path", | |
"required": true | |
} | |
], | |
"produces": [ | |
"application/json" | |
], | |
"responses": { | |
"200": { | |
"description": "", | |
"schema": { | |
"$ref": "#/definitions/User" | |
} | |
}, | |
"404": { | |
"description": "username not found" | |
} | |
} | |
} | |
}, | |
"/user/{username}/enabled": { | |
"put": { | |
"parameters": [ | |
{ | |
"type": "string", | |
"name": "username", | |
"in": "path", | |
"required": true | |
} | |
], | |
"produces": [ | |
"application/json" | |
], | |
"responses": { | |
"200": { | |
"description": "", | |
"schema": { | |
"type": "boolean" | |
} | |
}, | |
"404": { | |
"description": "username not found" | |
} | |
} | |
}, | |
"get": { | |
"parameters": [ | |
{ | |
"type": "string", | |
"name": "username", | |
"in": "path", | |
"required": true | |
} | |
], | |
"produces": [ | |
"application/json" | |
], | |
"responses": { | |
"200": { | |
"description": "", | |
"schema": { | |
"type": "boolean" | |
} | |
}, | |
"404": { | |
"description": "username not found" | |
} | |
} | |
} | |
}, | |
"/users": { | |
"get": { | |
"produces": [ | |
"application/json" | |
], | |
"responses": { | |
"200": { | |
"description": "", | |
"schema": { | |
"type": "array", | |
"items": { | |
"$ref": "#/definitions/User" | |
} | |
} | |
} | |
} | |
} | |
}, | |
"/user/admins": { | |
"get": { | |
"produces": [ | |
"application/json" | |
], | |
"responses": { | |
"200": { | |
"description": "", | |
"schema": { | |
"type": "array", | |
"items": { | |
"$ref": "#/definitions/Admin" | |
} | |
} | |
} | |
} | |
} | |
}, | |
"/user/admins/user/{username}": { | |
"put": { | |
"parameters": [ | |
{ | |
"type": "string", | |
"name": "username", | |
"in": "path", | |
"required": true | |
}, | |
{ | |
"name": "body", | |
"in": "body", | |
"schema": { | |
"type": "string" | |
} | |
} | |
], | |
"produces": [ | |
"application/json" | |
], | |
"responses": { | |
"204": { | |
"description": "" | |
}, | |
"400": { | |
"description": "Invalid body" | |
}, | |
"404": { | |
"description": "username not found" | |
} | |
}, | |
"consumes": [ | |
"application/json" | |
] | |
}, | |
"delete": { | |
"parameters": [ | |
{ | |
"type": "string", | |
"name": "username", | |
"in": "path", | |
"required": true | |
} | |
], | |
"produces": [ | |
"application/json" | |
], | |
"responses": { | |
"204": { | |
"description": "" | |
}, | |
"404": { | |
"description": "username not found" | |
} | |
} | |
} | |
} | |
}, | |
"definitions": { | |
"User": { | |
"properties": { | |
"userpwd": { | |
"type": "string" | |
}, | |
"userenabled": { | |
"type": "boolean" | |
}, | |
"username": { | |
"type": "string" | |
} | |
}, | |
"type": "object", | |
"required": [ | |
"username", | |
"userpwd", | |
"userenabled" | |
] | |
}, | |
"Admin": { | |
"properties": { | |
"adminUser": { | |
"$ref": "#/definitions/User" | |
}, | |
"otherDeets": { | |
"type": "string" | |
} | |
}, | |
"type": "object", | |
"required": [ | |
"adminUser", | |
"otherDeets" | |
] | |
} | |
}, | |
"info": { | |
"description": "A demo of servant-swagger", | |
"title": "Hackage Users API", | |
"version": "" | |
}, | |
"host": "hackage.haskell.org", | |
"swagger": "2.0" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment