wallet.andert.me/.wundergraph/schemas/placeholder.json

181 lines
5.5 KiB
JSON
Raw Normal View History

2023-09-20 11:10:16 +00:00
{
"openapi": "3.0.0",
"info": {
"version": "1.0.0",
"title": "JSON Placeholder API",
"description": "See https://jsonplaceholder.typicode.com/"
},
"servers": [
{
"url": "https://jsonplaceholder.typicode.com"
}
],
"paths": {
"/posts": {
"get": {
"description": "Returns all posts",
"tags": [
"Posts"
],
"operationId": "getPosts",
"responses": {
"200": {
"description": "Successful response",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/PostsList"
}
}
}
}
}
}
},
"/users": {
"get": {
"description": "Returns all users",
"tags": [
"Users"
],
"operationId": "getUsers",
"responses": {
"200": {
"description": "Successful response",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/UserList"
}
}
}
}
}
}
},
"/users/{id}": {
"get": {
"description": "Returns a user by id",
"tags": [
"Users"
],
"operationId": "getUser",
"parameters": [
{
"name": "id",
"in": "path",
"required": true,
"description": "The user id.",
"schema": {
"type": "integer",
"format": "int64"
}
}
],
"responses": {
"200": {
"description": "Successful response",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/User"
}
}
}
},
"404": {
"description": "User not found"
}
}
}
},
"/posts/{id}": {
"get": {
"description": "Returns a post by id",
"tags": [
"Posts"
],
"operationId": "getPost",
"parameters": [
{
"name": "id",
"in": "path",
"required": true,
"description": "The user id.",
"schema": {
"type": "integer",
"format": "int64"
}
}
],
"responses": {
"200": {
"description": "Successful response",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Post"
}
}
}
},
"404": {
"description": "Post not found"
}
}
}
}
},
"components": {
"schemas": {
"PostsList": {
"type": "array",
"items": {
"$ref": "#/components/schemas/Post"
}
},
"UserList": {
"type": "array",
"items": {
"$ref": "#/components/schemas/User"
}
},
"Post": {
"type": "object",
"required": [
"id",
"userId",
"title"
],
"properties": {
"id": {
"type": "integer"
},
"userId": {
"type": "integer"
},
"title": {
"type": "string"
}
}
},
"User": {
"type": "object",
"properties": {
"id": {
"type": "integer"
},
"name": {
"type": "string"
},
"username": {
"type": "string"
},
"email": {
"type": "string"
}
}
}
}
}
}