-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathapi.yaml
189 lines (174 loc) · 4.26 KB
/
api.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
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
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
###
### Open Badges Peer Endorsment API Spec
###
### Note: WIP
swagger: "2.0"
info:
description: ""
version: "1.0.0"
title: ""
# TODO: Fill out
# termsOfService: "http://swagger.io/terms/"
# contact:
# email: "apiteam@swagger.io"
# license:
# name: "Apache 2.0"
# url: "http://www.apache.org/licenses/LICENSE-2.0.html"
# host: "petstore.swagger.io"
# basePath: "/v1"
tags:
- name: "assertion"
description: "Everything about Badge Assertions"
- name: "class"
description: "Everything about Badge Classes"
schemes:
- "https"
- "http"
paths:
/shares:
post:
tags:
- "assertion"
summary: "Share an Assertion"
operationId: "shareAssertion"
consumes:
- "appliction/json"
parameters:
- in: "body"
name: "body"
description: "Pet object that needs to be added to the store"
required: true
schema:
$ref: "#/definitions/Assertion"
# TODO: Check error codes
responses:
405:
description: "Invalid input"
200:
description: "The shared Assertion"
schema:
$ref: "#/definitions/Share"
/shares/{shareId}:
get:
tags:
- "assertion"
summary: "Request an Assertion by it's id"
operationId: "getAssertion"
parameters:
- name: "shareId"
description: "The id of the Assertion you want to request"
in: "path"
required: true
type: "string"
# TODO: Check error codes
responses:
200:
description: "The requested Assertion"
schema:
$ref: "#/definitions/Share"
/shares/{shareId}/endorse:
post:
tags:
- "assertion"
summary: "Submit an endorsment/signature"
operationId: "submitSignedAssertion"
parameters:
- name: "shareId"
description: "The id of the Assertion you want to endorse"
in: "path"
required: true
type: "string"
- name: "endorsment"
description: "Endorsment data"
in: "body"
required: true
schema:
$ref: '#/definitions/Endorsment'
# TODO: Check error codes
responses:
200:
description: "Succesful endorsment"
# TODO: Check possible return value
/classes:
get:
tags:
- "class"
summary: "Request the collection of Badge Classes"
operationId: "getBadgeClasses"
consumes:
- "application/json"
# TODO: Check error codes
responses:
200:
description: "The collection of Badge Classes"
schema:
type: "array"
items:
$ref: "#/definitions/BadgeClass"
definitions:
Share:
type: object
properties:
id:
$ref: "#/definitions/HashId"
assertion:
$ref: "#/definitions/Assertion"
# TODO: Check required data
Assertion:
type: object
properties:
id:
type: string
format: uuid
type:
type: string
enum: [Assertion]
identity:
$ref: "#/definitions/IdentityObject"
badge:
$ref: "#/definitions/BadgeClass"
BadgeClass:
type: object
properties:
type:
type: string
enum: [BadgeClass]
image:
type: string
format: url
example: "https://badgeframework/classes/coolclass"
name:
type: string
example: "Demo Badge Creator"
description:
type: string
example: "You can fluently create demo badges for demo purposes."
issuer:
type: string
format: url
example: "https://bskilled.com/profiles/abcd45a"
criteria:
type: string
example: "You need to have created at least one demo badge."
IdentityObject:
type: object
properties:
identity:
type: string
format: email
type:
type: string
enum: [email]
hashed:
type: boolean
enum: [false]
# TODO: Check required data
Endorsment:
type: object
properties:
signature:
type: string
HashId:
type: string
example: "fe3bb9ac"
description: "A representation of the resource ID that is not just an incrementing number"