Skip to content

Commit 6b678d1

Browse files
gracekarinafrantuma
authored andcommitted
oas 3.1 - basic oas31 yaml file for testing
1 parent 7c63253 commit 6b678d1

File tree

1 file changed

+164
-0
lines changed

1 file changed

+164
-0
lines changed
Lines changed: 164 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,164 @@
1+
openapi: "3.1.0"
2+
info:
3+
version: 1.0.0
4+
title: Swagger Petstore
5+
license:
6+
name: MIT
7+
identifier: test
8+
servers:
9+
- url: http://petstore.swagger.io/v1
10+
webhooks:
11+
# Each webhook needs a name
12+
newPet:
13+
# This is a Path Item Object, the only difference is that the request is initiated by the API provider
14+
post:
15+
requestBody:
16+
description: Information about a new pet in the system
17+
content:
18+
application/json:
19+
schema:
20+
$ref: "#/components/schemas/Pet"
21+
description: pet
22+
responses:
23+
"200":
24+
description: Return a 200 status to indicate that the data was received successfully
25+
paths:
26+
/pets:
27+
get:
28+
summary: List all pets
29+
operationId: listPets
30+
tags:
31+
- pets
32+
parameters:
33+
- name: limit
34+
in: query
35+
description: How many items to return at one time (max 100)
36+
required: false
37+
schema:
38+
type: integer
39+
format: int32
40+
responses:
41+
"200":
42+
description: An paged array of pets
43+
headers:
44+
x-next:
45+
description: A link to the next page of responses
46+
schema:
47+
type: string
48+
content:
49+
application/json:
50+
schema:
51+
$ref: "#/components/schemas/Pets"
52+
default:
53+
description: unexpected error
54+
content:
55+
application/json:
56+
schema:
57+
$ref: "#/components/schemas/Error"
58+
description: error
59+
post:
60+
summary: Create a pet
61+
operationId: createPets
62+
tags:
63+
- pets
64+
responses:
65+
"201":
66+
description: Null response
67+
default:
68+
description: unexpected error
69+
content:
70+
application/json:
71+
schema:
72+
$ref: "#/components/schemas/Tag"
73+
/pets/{petId}:
74+
get:
75+
summary: Info for a specific pet
76+
operationId: showPetById
77+
tags:
78+
- pets
79+
parameters:
80+
- name: petId
81+
in: path
82+
required: true
83+
description: The id of the pet to retrieve
84+
schema:
85+
type: string
86+
- $ref: "#/components/parameters/User"
87+
description: user
88+
summary: user
89+
responses:
90+
"200":
91+
description: Expected response to a valid request
92+
content:
93+
application/json:
94+
schema:
95+
$ref: "#/components/schemas/Pets"
96+
default:
97+
description: unexpected error
98+
content:
99+
application/json:
100+
schema:
101+
$ref: "#/components/schemas/Error"
102+
components:
103+
parameters:
104+
User:
105+
in: query
106+
description: user
107+
name: user
108+
schema:
109+
type: string
110+
schemas:
111+
Pet:
112+
type:
113+
- object
114+
- string
115+
required:
116+
- id
117+
- name
118+
properties:
119+
id:
120+
type: integer
121+
format: int64
122+
name:
123+
type: string
124+
testenum:
125+
type: string
126+
enum:
127+
- available
128+
- pending
129+
- sold
130+
default: available
131+
testconst:
132+
type: string
133+
const: pending
134+
tag:
135+
type: string
136+
arbitraryKeyword: test
137+
Pets:
138+
type: array
139+
items:
140+
$ref: "#/components/schemas/Pet"
141+
Error:
142+
required:
143+
- code
144+
- message
145+
properties:
146+
code:
147+
type: integer
148+
format: int32
149+
message:
150+
type: string
151+
tag:
152+
$ref: "#/components/schemas/Tag"
153+
Tag:
154+
type:
155+
- object
156+
- string
157+
- string
158+
- foo
159+
properties:
160+
id:
161+
type: integer
162+
format: int64
163+
name:
164+
type: string

0 commit comments

Comments
 (0)