-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathopenapi.yaml
92 lines (87 loc) · 2.69 KB
/
openapi.yaml
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
openapi: 3.0.0
info:
title: Journal API
description: API to log and search simple markdown journal entries
version: 0.0.1-SNAPSHOT
paths:
/entries/append:
post:
summary: Create a journal entry
description: Add a journal entry to the journal at the current time
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/DraftEntry'
responses:
'200':
description: Journal entry was created successfully
/entries:
get:
summary: Returns an ordered collection of journal entries
description: Fetch journal entries in reverse date order (most recent first) within defined parameters
parameters:
- name: contains
in: path
required: false
description: Filter to only include entries which have this value in their body
schema:
type: string
- name: start
in: path
required: false
description: Return only entries from this index onwards in the pool
schema:
type: integer
- name: limit
in: path
required: false
description: Return this number of entries at most. There can be less than this in the pool
schema:
type: integer
responses:
'200':
description: A JSON object containing a paging header and journal entry data
content:
application/json:
schema:
$ref: '#/components/schemas/EntryListing'
# Descriptions of common components
components:
schemas:
# Schema for a single journal entry not yet assigned a date
DraftEntry:
type: object
properties:
body:
type: string
description: The markdown content of the journal entry
# Schema for a single journal entry
Entry:
type: object
properties:
body:
type: string
description: The markdown content of the journal entry
creation:
type: string
format: date-time
description: The date the API recorded this entry
# Schema for a list of paged journal entries
EntryListing:
type: object
properties:
size:
type: integer
description: The size of the pool from which this data was sourced
limit:
type: integer
description: The maximum number of elements returned
startIndex:
type: integer
description: The starting index in the pool from which this data was sourced
data:
type: array
items:
$ref: '#components/schemas/Entry'