mirror of
https://github.com/usebruno/bruno.git
synced 2026-06-15 20:01:28 +00:00
213 lines
4.7 KiB
JSON
213 lines
4.7 KiB
JSON
{
|
|
"openapi": "3.0.0",
|
|
"info": {
|
|
"title": "Simple Test API",
|
|
"version": "1.0.0",
|
|
"description": "A simple API for testing groupBy functionality"
|
|
},
|
|
"servers": [
|
|
{
|
|
"url": "https://api.example.com",
|
|
"description": "Example server"
|
|
}
|
|
],
|
|
"paths": {
|
|
"/users": {
|
|
"get": {
|
|
"summary": "Get all users",
|
|
"operationId": "getUsers",
|
|
"tags": ["users"],
|
|
"responses": {
|
|
"200": {
|
|
"description": "List of users",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"type": "array",
|
|
"items": {
|
|
"type": "object",
|
|
"properties": {
|
|
"id": { "type": "integer" },
|
|
"name": { "type": "string" }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"post": {
|
|
"summary": "Create user",
|
|
"operationId": "createUser",
|
|
"tags": ["users"],
|
|
"requestBody": {
|
|
"required": true,
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"type": "object",
|
|
"properties": {
|
|
"name": { "type": "string" }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"responses": {
|
|
"201": {
|
|
"description": "User created"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/users/{id}": {
|
|
"get": {
|
|
"summary": "Get user by ID",
|
|
"operationId": "getUserById",
|
|
"tags": ["users"],
|
|
"parameters": [
|
|
{
|
|
"name": "id",
|
|
"in": "path",
|
|
"required": true,
|
|
"schema": {
|
|
"type": "integer"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "User details"
|
|
}
|
|
}
|
|
},
|
|
"put": {
|
|
"summary": "Update user",
|
|
"operationId": "updateUser",
|
|
"tags": ["users"],
|
|
"parameters": [
|
|
{
|
|
"name": "id",
|
|
"in": "path",
|
|
"required": true,
|
|
"schema": {
|
|
"type": "integer"
|
|
}
|
|
}
|
|
],
|
|
"requestBody": {
|
|
"required": true,
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"type": "object",
|
|
"properties": {
|
|
"name": { "type": "string" }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"responses": {
|
|
"200": {
|
|
"description": "User updated"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/products": {
|
|
"get": {
|
|
"summary": "Get all products",
|
|
"operationId": "getProducts",
|
|
"tags": ["products"],
|
|
"responses": {
|
|
"200": {
|
|
"description": "List of products"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/products/{id}": {
|
|
"get": {
|
|
"summary": "Get product by ID",
|
|
"operationId": "getProductById",
|
|
"tags": ["products"],
|
|
"parameters": [
|
|
{
|
|
"name": "id",
|
|
"in": "path",
|
|
"required": true,
|
|
"schema": {
|
|
"type": "integer"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "Product details"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/orders": {
|
|
"get": {
|
|
"summary": "Get all orders",
|
|
"operationId": "getOrders",
|
|
"tags": ["orders"],
|
|
"responses": {
|
|
"200": {
|
|
"description": "List of orders"
|
|
}
|
|
}
|
|
},
|
|
"post": {
|
|
"summary": "Create order",
|
|
"operationId": "createOrder",
|
|
"tags": ["orders"],
|
|
"requestBody": {
|
|
"required": true,
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"type": "object",
|
|
"properties": {
|
|
"userId": { "type": "integer" },
|
|
"productId": { "type": "integer" }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"responses": {
|
|
"201": {
|
|
"description": "Order created"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/orders/{id}": {
|
|
"get": {
|
|
"summary": "Get order by ID",
|
|
"operationId": "getOrderById",
|
|
"tags": ["orders"],
|
|
"parameters": [
|
|
{
|
|
"name": "id",
|
|
"in": "path",
|
|
"required": true,
|
|
"schema": {
|
|
"type": "integer"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "Order details"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|