Skip to content

Commit 9eecb44

Browse files
committed
v0-added-demo-openapi-specification-for-testing
1 parent 2222774 commit 9eecb44

File tree

1 file changed

+58
-0
lines changed

1 file changed

+58
-0
lines changed

src/main/resources/openapi.yaml

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
openapi: 3.0.3
2+
info:
3+
title: Simple Items API
4+
version: "1.0.0"
5+
description: A simple API to manage items.
6+
servers:
7+
- url: https://api.example.com/v1
8+
paths:
9+
/items:
10+
get:
11+
summary: Retrieve a list of items.
12+
responses:
13+
'200':
14+
description: A JSON array of items.
15+
content:
16+
application/json:
17+
schema:
18+
type: array
19+
items:
20+
$ref: '#/components/schemas/Item'
21+
post:
22+
summary: Create a new item.
23+
requestBody:
24+
required: true
25+
content:
26+
application/json:
27+
schema:
28+
$ref: '#/components/schemas/Item'
29+
responses:
30+
'201':
31+
description: Item created successfully.
32+
/items/{itemId}:
33+
get:
34+
summary: Retrieve a specific item by ID.
35+
parameters:
36+
- in: path
37+
name: itemId
38+
required: true
39+
schema:
40+
type: string
41+
responses:
42+
'200':
43+
description: A single item.
44+
content:
45+
application/json:
46+
schema:
47+
$ref: '#/components/schemas/Item'
48+
components:
49+
schemas:
50+
Item:
51+
type: object
52+
properties:
53+
id:
54+
type: string
55+
name:
56+
type: string
57+
price:
58+
type: number

0 commit comments

Comments
 (0)