2019-12-02 23:18:00 +01:00
|
|
|
swagger: "2.0"
|
|
|
|
info:
|
2019-12-03 21:30:47 +01:00
|
|
|
description: "Resources Manager API"
|
2019-12-02 23:18:00 +01:00
|
|
|
version: "1.0.0"
|
|
|
|
title: "SimplePad API"
|
2019-12-03 21:30:47 +01:00
|
|
|
host: "localhost"
|
2019-12-02 23:18:00 +01:00
|
|
|
basePath: "/api"
|
|
|
|
tags:
|
2019-12-03 21:30:47 +01:00
|
|
|
- name: "user"
|
|
|
|
description: "Operations about user"
|
2019-12-02 23:18:00 +01:00
|
|
|
schemes:
|
|
|
|
- "https"
|
|
|
|
- "http"
|
|
|
|
paths:
|
2019-12-03 21:30:47 +01:00
|
|
|
/user:
|
2019-12-02 23:18:00 +01:00
|
|
|
post:
|
|
|
|
tags:
|
2019-12-03 21:30:47 +01:00
|
|
|
- "user"
|
|
|
|
summary: "Create user"
|
|
|
|
description: "Need pass an api key to authentificate."
|
|
|
|
operationId: "createUser"
|
|
|
|
produces:
|
2019-12-02 23:18:00 +01:00
|
|
|
- "application/json"
|
2019-12-03 21:30:47 +01:00
|
|
|
parameters:
|
|
|
|
- in: "body"
|
|
|
|
name: "body"
|
|
|
|
description: "Created user object"
|
|
|
|
required: true
|
|
|
|
schema:
|
|
|
|
$ref: "#/definitions/User"
|
|
|
|
- in: header
|
|
|
|
name: X-API-Key
|
|
|
|
type: string
|
|
|
|
required: true
|
|
|
|
responses:
|
|
|
|
default:
|
|
|
|
description: "successful operation"
|
|
|
|
/user/createWithArray:
|
|
|
|
post:
|
|
|
|
tags:
|
|
|
|
- "user"
|
|
|
|
summary: "Creates list of users with given input array"
|
|
|
|
description: ""
|
|
|
|
operationId: "createUsersWithArrayInput"
|
2019-12-02 23:18:00 +01:00
|
|
|
produces:
|
2019-12-03 21:30:47 +01:00
|
|
|
- "application/xml"
|
2019-12-02 23:18:00 +01:00
|
|
|
- "application/json"
|
|
|
|
parameters:
|
|
|
|
- in: "body"
|
|
|
|
name: "body"
|
2019-12-03 21:30:47 +01:00
|
|
|
description: "List of user object"
|
2019-12-02 23:18:00 +01:00
|
|
|
required: true
|
|
|
|
schema:
|
2019-12-03 21:30:47 +01:00
|
|
|
type: "array"
|
|
|
|
items:
|
|
|
|
$ref: "#/definitions/User"
|
|
|
|
- in: header
|
|
|
|
name: X-API-Key
|
|
|
|
type: string
|
|
|
|
required: true
|
2019-12-02 23:18:00 +01:00
|
|
|
responses:
|
2019-12-03 21:30:47 +01:00
|
|
|
default:
|
|
|
|
description: "successful operation"
|
|
|
|
/user/createWithList:
|
|
|
|
post:
|
|
|
|
tags:
|
|
|
|
- "user"
|
|
|
|
summary: "Creates list of users with given input array"
|
|
|
|
description: ""
|
|
|
|
operationId: "createUsersWithListInput"
|
|
|
|
produces:
|
|
|
|
- "application/xml"
|
|
|
|
- "application/json"
|
|
|
|
parameters:
|
|
|
|
- in: "body"
|
|
|
|
name: "body"
|
|
|
|
description: "List of user object"
|
|
|
|
required: true
|
|
|
|
schema:
|
|
|
|
type: "array"
|
|
|
|
items:
|
|
|
|
$ref: "#/definitions/User"
|
|
|
|
- in: header
|
|
|
|
name: X-API-Key
|
|
|
|
type: string
|
|
|
|
required: true
|
|
|
|
responses:
|
|
|
|
default:
|
|
|
|
description: "successful operation"
|
|
|
|
/user/{username}:
|
2019-12-02 23:18:00 +01:00
|
|
|
get:
|
|
|
|
tags:
|
2019-12-03 21:30:47 +01:00
|
|
|
- "user"
|
|
|
|
summary: "Get user by user name"
|
|
|
|
description: ""
|
|
|
|
operationId: "getUserByName"
|
2019-12-02 23:18:00 +01:00
|
|
|
produces:
|
2019-12-03 21:30:47 +01:00
|
|
|
- "application/xml"
|
2019-12-02 23:18:00 +01:00
|
|
|
- "application/json"
|
|
|
|
parameters:
|
2019-12-03 21:30:47 +01:00
|
|
|
- name: "username"
|
|
|
|
in: "path"
|
|
|
|
description: "The name that needs to be fetched."
|
2019-12-02 23:18:00 +01:00
|
|
|
required: true
|
2019-12-03 21:30:47 +01:00
|
|
|
type: "string"
|
|
|
|
- in: header
|
|
|
|
name: X-API-Key
|
2019-12-02 23:18:00 +01:00
|
|
|
type: string
|
2019-12-03 21:30:47 +01:00
|
|
|
required: false
|
2019-12-02 23:18:00 +01:00
|
|
|
responses:
|
|
|
|
200:
|
2019-12-03 21:30:47 +01:00
|
|
|
description: "successful operation"
|
2019-12-02 23:18:00 +01:00
|
|
|
schema:
|
2019-12-03 21:30:47 +01:00
|
|
|
$ref: "#/definitions/User"
|
|
|
|
400:
|
|
|
|
description: "Invalid username supplied"
|
|
|
|
404:
|
|
|
|
description: "User not found"
|
|
|
|
put:
|
2019-12-02 23:18:00 +01:00
|
|
|
tags:
|
2019-12-03 21:30:47 +01:00
|
|
|
- "user"
|
|
|
|
summary: "Updated user"
|
|
|
|
description: "This can only be done by the logged in user."
|
|
|
|
operationId: "updateUser"
|
2019-12-02 23:18:00 +01:00
|
|
|
produces:
|
2019-12-03 21:30:47 +01:00
|
|
|
- "application/xml"
|
2019-12-02 23:18:00 +01:00
|
|
|
- "application/json"
|
|
|
|
parameters:
|
2019-12-03 21:30:47 +01:00
|
|
|
- name: "username"
|
|
|
|
in: "path"
|
|
|
|
description: "name that need to be updated"
|
2019-12-02 23:18:00 +01:00
|
|
|
required: true
|
2019-12-03 21:30:47 +01:00
|
|
|
type: "string"
|
2019-12-02 23:18:00 +01:00
|
|
|
- in: "body"
|
|
|
|
name: "body"
|
2019-12-03 21:30:47 +01:00
|
|
|
description: "Updated user object"
|
2019-12-02 23:18:00 +01:00
|
|
|
required: true
|
|
|
|
schema:
|
2019-12-03 21:30:47 +01:00
|
|
|
$ref: "#/definitions/User"
|
|
|
|
- in: header
|
|
|
|
name: X-API-Key
|
|
|
|
type: string
|
|
|
|
required: true
|
2019-12-02 23:18:00 +01:00
|
|
|
responses:
|
2019-12-03 21:30:47 +01:00
|
|
|
400:
|
|
|
|
description: "Invalid user supplied"
|
|
|
|
404:
|
|
|
|
description: "User not found"
|
|
|
|
delete:
|
|
|
|
tags:
|
|
|
|
- "user"
|
|
|
|
summary: "Delete user"
|
|
|
|
description: "This can only be done by the logged in user."
|
|
|
|
operationId: "deleteUser"
|
|
|
|
produces:
|
|
|
|
- "application/xml"
|
|
|
|
- "application/json"
|
|
|
|
parameters:
|
|
|
|
- name: "username"
|
|
|
|
in: "path"
|
|
|
|
description: "The name that needs to be deleted"
|
|
|
|
required: true
|
|
|
|
type: "string"
|
|
|
|
- in: header
|
|
|
|
name: X-API-Key
|
|
|
|
type: string
|
|
|
|
required: true
|
|
|
|
responses:
|
|
|
|
400:
|
|
|
|
description: "Invalid username supplied"
|
|
|
|
404:
|
|
|
|
description: "User not found"
|
2019-12-02 23:18:00 +01:00
|
|
|
definitions:
|
2019-12-03 21:30:47 +01:00
|
|
|
User:
|
2019-12-02 23:18:00 +01:00
|
|
|
type: "object"
|
|
|
|
properties:
|
|
|
|
id:
|
2019-12-03 21:30:47 +01:00
|
|
|
type: "integer"
|
|
|
|
format: "int64"
|
|
|
|
username:
|
|
|
|
type: "string"
|
|
|
|
firstName:
|
|
|
|
type: "string"
|
|
|
|
lastName:
|
|
|
|
type: "string"
|
|
|
|
email:
|
|
|
|
type: "string"
|
|
|
|
password:
|
|
|
|
type: "string"
|
|
|
|
phone:
|
|
|
|
type: "string"
|
|
|
|
userStatus:
|
|
|
|
type: "integer"
|
|
|
|
format: "int32"
|
|
|
|
description: "User Status"
|