1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134
|
swagger: "2.0"
info:
title: Batcomputer API
version: "1.0.0"
host: api.batcomputer.com
paths:
/persons:
get:
summary: List Persons
description: |
Retrieves a list of all persons on file in the bat computer.
responses:
200:
description: An array of Persons
schema:
type: array
items:
$ref: '#/definitions/Person'
/evidence:
get:
summary: List Evidence
description: |
Retrieves a list of evidence ever found by world's greatest
detective and his family.
parameters:
- name: marker
in: query
type: integer
minimum: -1
default: -1
format: int64
required: false
description: |
The id of the last seen evidence. It's used for pagination purpose
by returning 'limit' number of evidence after this one.
- name: limit
in: query
type: integer
format: int32
minimum: 1
maximum: 1000
default: 20
required: false
description: |
The maximum number of evidence to be returned by the query.
responses:
200:
description: An array of evidence.
schema:
type: array
items:
$ref: '#/definitions/Evidence'
post:
summary: Create an Evidence
description: |
Creates a new evidence record in database.
parameters:
- name: evidence
in: body
schema:
$ref: '#/definitions/Evidence'
responses:
201:
description: An evidence.
schema:
$ref: '#/definitions/Evidence'
/evidence/{id}:
get:
summary: Show Requested Evidence
description: |
Queries and returns an evidence with a passed ID.
parameters:
- name: id
in: path
type: integer
format: int64
required: true
description: |
A unique evidence identifier to query.
- name: If-None-Match
in: header
type: string
description: |
Executes a request only if passed ETag doesn't equal to current
resource one (i.e. resource has been changed).
responses:
200:
description: An evidence.
schema:
$ref: '#/definitions/Evidence'
headers:
ETag:
description: |
Entity tag is part of HTTP provided for web cache validation
problem, but also used for optimistic concurrency control.
type: string
404:
description: Evidence not found.
schema:
$ref: '#/definitions/Error'
definitions:
Evidence:
type: object
properties:
id:
type: integer
format: int64
description: A unique evidence identifier.
case:
type: string
description: A case when the evidence is found.
data:
type: string
format: binary
description: An evidence itself.
Error:
type: object
properties:
code:
type: string
description: A uniqe identifier of error.
message:
type: string
description: A human readable error message.
Person:
type: object
properties:
id:
type: integer
format: int64
description: Unique ID for a person
name:
type: string
description: Name of a person
|