-
Notifications
You must be signed in to change notification settings - Fork 0
/
spec.yaml
59 lines (58 loc) · 1.68 KB
/
spec.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
openapi: 3.0.0
info:
version: 1.0.0
title: nsfwoid
description: image NSFW likelihood scoring as a web service, based on Yahoo's open_nsfw project
termsOfService: https://wikimediafoundation.org/wiki/Terms_of_Use
contact:
name: Wikimedia Product Infrastructure team
url: https://www.mediawiki.org/wiki/Wikimedia_Product/Wikimedia_Product_Infrastructure_team
license:
name: Apache2
url: http://www.apache.org/licenses/LICENSE-2.0
paths:
/:
get:
description: The root service end-point
responses:
200:
description: Success
default:
description: Error
x-amples:
- title: spec from root
request:
query:
spec: true
response:
status: 200
post:
description: Accepts URL of image for scoring
requestBody:
content:
multipart/form-data:
schema:
properties:
url:
type: string
description: URL of image to score
required: true
responses:
200:
description: NSFW likelihood score
content:
text/plain:
schema:
type: string
default:
description: Error
x-amples:
- title: Responds to POSTed image URL with NSFW likelihood score
request:
body:
url: https://upload.wikimedia.org/wikipedia/commons/thumb/f/f5/Jimmy-wales-frankfurt2005-alih01.jpg/160px-Jimmy-wales-frankfurt2005-alih01.jpg
response:
status: 200
headers:
content-type: text/plain
body: /0\.0.+/