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

141 lines
3.2 KiB
YAML
Executable File

---
swagger: "2.0"
info:
description: "DualInventive's common companies API"
version: "1.0.1"
title: "Companies API"
termsOfService: "http://swagger.io/terms/"
contact:
name: "sven.vantrijp@dualinventive.com"
license:
name: "Apache 2.0"
url: "http://www.apache.org/licenses/LICENSE-2.0.html"
host: "api.mtinfo3000.com"
basePath: "/companies-service/v1"
schemes:
- "https"
securityDefinitions:
AccessToken:
type: apiKey
in: header
name: Authorization
paths:
/companies/{companyID}:
get:
tags:
- "Companies"
summary: ""
description: "Returns a Company by the given companyID"
operationId: "GetCompanyByID"
consumes:
- "application/json"
produces:
- "application/json"
security:
- AccessToken: []
parameters:
- name: companyID
description: CompanyID
in: path
required: true
type: integer
minimum: 1
responses:
200:
description: "successful operation"
schema:
$ref: "#/definitions/Company"
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"
/companies:
get:
tags:
- "Companies"
summary: ""
description: "Returns a list of companies"
operationId: "GetCompanies"
consumes:
- "application/json"
produces:
- "application/json"
security:
- AccessToken: []
parameters:
- 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/CompaniesList"
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"
Company:
properties:
id:
type: integer
name:
type: string
code:
type: string
CompaniesList:
properties:
company:
type: array
items:
$ref: "#/definitions/Company"
count:
type: integer