src.dualinventive.com/go/users-service/rest/swagger.yaml

173 lines
3.8 KiB
YAML
Executable File

---
swagger: "2.0"
info:
description: "DualInventive's common user API"
version: "1.0.1"
title: "Users API"
termsOfService: "http://swagger.io/terms/"
contact:
name: "patrick.vanleeuwen@dualinventive.com"
license:
name: "Apache 2.0"
url: "http://www.apache.org/licenses/LICENSE-2.0.html"
host: "api.mtinfo3000.com"
basePath: "/users-service/v1"
schemes:
- "https"
securityDefinitions:
AccessToken:
type: apiKey
in: header
name: Authorization
paths:
/users/{userID}:
get:
tags:
- "Users"
summary: ""
description: "Returns a User by the given userID"
operationId: "GetUserByID"
consumes:
- "application/json"
produces:
- "application/json"
security:
- AccessToken: []
parameters:
- name: userID
description: UserID
in: path
required: true
type: integer
minimum: 1
responses:
200:
description: "successful operation"
schema:
$ref: "#/definitions/User"
401:
description: "authentication failed"
schema:
$ref: "#/definitions/ErrResponse"
404:
description: "not found"
schema:
$ref: "#/definitions/ErrResponse"
500:
description: "internal server error"
schema:
$ref: "#/definitions/ErrResponse"
/users:
get:
tags:
- "Users"
summary: ""
description: "Returns a list of users"
operationId: "ListUsers"
consumes:
- "application/json"
produces:
- "application/json"
security:
- AccessToken: []
parameters:
- name: reference
description: Reference filter
in: query
required: false
type: string
- name: page
description: Page number
in: query
required: false
type: integer
default: 1
minimum: 1
- name: per_page
description: Items per page
in: query
required: false
type: integer
default: 200
minimum: 1
maximum: 200
- name: sort
description: Sorting column
in: query
required: false
type: string
enum:
- id
- id:asc
- id:desc
- name
- name:asc
- name:desc
default: id
responses:
200:
description: "successful operation"
schema:
$ref: "#/definitions/UsersList"
401:
description: "authentication failed"
schema:
$ref: "#/definitions/ErrResponse"
404:
description: "not found"
schema:
$ref: "#/definitions/ErrResponse"
500:
description: "internal server error"
schema:
$ref: "#/definitions/ErrResponse"
definitions:
ErrResponse:
properties:
errMsg:
type: "string"
User:
properties:
id:
type: integer
username:
type: string
firstname:
type: string
lastname:
type: string
roles:
type: "array"
items:
type: "object"
properties:
name:
type: "string"
rights:
type: "array"
items:
type: "string"
company:
type: "object"
properties:
id:
type: "integer"
name:
type: "string"
code:
type: "string"
reference:
type: string
UsersList:
properties:
users:
type: array
items:
$ref: "#/definitions/User"
count:
type: integer