-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathswagger.yaml
104 lines (103 loc) · 2.59 KB
/
swagger.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
openapi: 3.0.3
info:
title: Sky's UPC Database
description: This is a free and open-source UPC database.
contact:
email: [email protected]
version: 1.0.0
servers:
- url: https://upc.skystuff.cc/api/
tags:
- name: UPC
description: Everything about your Pets
paths:
/upc/{upc}:
get:
tags:
- UPC
summary: Get information about a UPC code.
parameters:
- in: path
name: upc
schema:
type: integer
required: true
description: 8 or 12 digit UPC code to look up.
description: Get information about a UPC code.
operationId: getUPC
responses:
'200':
description: Successful operation
content:
application/json:
schema:
$ref: '#/components/schemas/upc'
'400':
description: Invalid UPC
'404':
description: UPC Not Found
/upc/:
post:
tags:
- UPC
summary: Upload data about a UPC to the database.
description: Upload data about a UPC to the database.
operationId: addUPC
requestBody:
description: Upload data
content:
application/json:
schema:
$ref: '#/components/schemas/upc'
required: true
responses:
'200':
description: Successful operation
'400':
description: Invalid input
/upc/bulk/:
get:
tags:
- UPC
summary: Get bulk data for up to 50 UPCs
description: Returns bulk data for 50 UPCs, and processes them to ensure they are good. You can pass 50 real UPCs, and some invalid ones, and it will filter out the invalid ones.
operationId: upc.bulk
parameters:
- in: query
name: upcs
schema:
type: string
required: true
description: Comma separated UPCs
responses:
'200':
description: Successful operation.
content:
application/json:
schema:
$ref: '#/components/schemas/BulkUPC'
'400':
description: Too many UPCs requested.
/upc/validate/{upc}:
get:
tags:
- UPC
summary: Test if a UPC is valid
description: Returns a boolean on if a UPC is valid or not.
operationId: upc.validate
components:
schemas:
upc:
type: object
properties:
upc:
type: string
name:
type: string
quantity:
type: string
quantity_unit:
type: string
required:
- upc
- name