{ "swagger": "2.0", "info": { "description": "Fake Online HTTP API for Testing and Prototyping", "version": "1.0.0", "title": "JSON Placeholder" }, "host": "jsonplaceholder.typicode.com", "tags": [ { "name": "posts" }, { "name": "comments" }, { "name": "albums" }, { "name": "photos" }, { "name": "todos" }, { "name": "users" } ], "schemes": ["https"], "paths": { "/posts": { "get": { "tags": ["posts"], "operationId": "getPosts", "summary": "Get all available posts", "parameters": [ { "name": "id", "in": "query", "type": "integer", "description": "Filter by post ID", "required": false }, { "name": "userId", "in": "query", "type": "integer", "description": "Filter by user ID", "required": false } ], "produces": ["application/json"], "responses": { "200": { "description": "successful operation", "schema": { "type": "array", "items": { "$ref": "#/definitions/Post" } } } } }, "post": { "tags": ["posts"], "operationId": "createPost", "summary": "Create a post", "parameters": [ { "in": "body", "name": "body", "description": "Post object that needs to be added", "required": true, "schema": { "$ref": "#/definitions/Post" } } ], "consumes": ["application/json"], "produces": ["application/json"], "responses": { "200": { "description": "successful operation", "schema": { "$ref": "#/definitions/Post" } } } } }, "/posts/{id}": { "get": { "tags": ["posts"], "operationId": "getPostById", "summary": "Get specific post", "parameters": [ { "name": "id", "in": "path", "description": "The ID of the post to retrieve", "required": true, "type": "integer" } ], "responses": { "200": { "description": "successful operation", "schema": { "$ref": "#/definitions/Post" } }, "404": { "description": "not found", "schema": { "$ref": "#/definitions/NotFoundError" } } } }, "put": { "tags": ["posts"], "operationId": "updatePostById", "summary": "Update specific post", "parameters": [ { "name": "id", "in": "path", "description": "The ID of the post to retrieve", "required": true, "type": "integer" }, { "in": "body", "name": "body", "description": "Post object that needs to be updated", "required": true, "schema": { "$ref": "#/definitions/Post" } } ], "responses": { "200": { "description": "successful operation", "schema": { "$ref": "#/definitions/Post" } }, "404": { "description": "not found", "schema": { "$ref": "#/definitions/NotFoundError" } } } }, "patch": { "tags": ["posts"], "operationId": "patchPostById", "summary": "patch specific post", "parameters": [ { "name": "id", "in": "path", "description": "The ID of the post to retrieve", "required": true, "type": "integer" }, { "in": "body", "name": "body", "description": "Post object that needs to be updated", "required": true, "schema": { "$ref": "#/definitions/Post" } } ], "responses": { "200": { "description": "successful operation", "schema": { "$ref": "#/definitions/Post" } }, "404": { "description": "not found", "schema": { "$ref": "#/definitions/NotFoundError" } } } }, "delete": { "tags": ["posts"], "operationId": "deletePostById", "summary": "Delete specific post", "parameters": [ { "name": "id", "in": "path", "description": "The ID of the post to retrieve", "required": true, "type": "integer" } ], "responses": { "204": { "description": "successful operation" }, "404": { "description": "not found", "schema": { "$ref": "#/definitions/NotFoundError" } } } } }, "/posts/{id}/comments": { "get": { "tags": ["posts"], "summary": "Get comments for a specific post", "parameters": [ { "name": "id", "in": "path", "description": "post id", "required": true, "type": "integer" } ], "responses": { "200": { "description": "successful operation", "schema": { "type": "array", "items": { "$ref": "#/definitions/Comment" } } }, "404": { "description": "not found", "schema": { "$ref": "#/definitions/NotFoundError" } } } } }, "/comments": { "get": { "tags": ["comments"], "operationId": "getComments", "summary": "Get all available comments", "parameters": [ { "name": "id", "in": "query", "type": "integer", "description": "Filter by comment ID", "required": false }, { "name": "postId", "in": "query", "type": "integer", "description": "Filter by post ID", "required": false } ], "produces": ["application/json"], "responses": { "200": { "description": "successful operation", "schema": { "type": "array", "items": { "$ref": "#/definitions/Comment" } } } } } }, "/comments/{id}": { "get": { "tags": ["comments"], "operationId": "getComment", "summary": "Get specific comment", "parameters": [ { "name": "id", "in": "path", "description": "The ID of the comment to retrieve", "required": true, "type": "integer" } ], "responses": { "200": { "description": "successful operation", "schema": { "$ref": "#/definitions/Comment" } }, "404": { "description": "not found", "schema": { "$ref": "#/definitions/NotFoundError" } } } } }, "/albums": { "get": { "tags": ["albums"], "operationId": "getAlbums", "summary": "Get all available albums", "parameters": [ { "name": "id", "in": "query", "type": "integer", "description": "Filter by album ID", "required": false }, { "name": "userId", "in": "query", "type": "integer", "description": "Filter by user ID", "required": false } ], "produces": ["application/json"], "responses": { "200": { "description": "successful operation", "schema": { "type": "array", "items": { "$ref": "#/definitions/Album" } } } } } }, "/albums/{id}": { "get": { "tags": ["albums"], "summary": "Get specific album", "parameters": [ { "name": "id", "in": "path", "description": "The ID of the album to retrieve", "required": true, "type": "integer" } ], "responses": { "200": { "description": "successful operation", "schema": { "$ref": "#/definitions/Album" } }, "404": { "description": "not found", "schema": { "$ref": "#/definitions/NotFoundError" } } } } }, "/albums/{id}/photos": { "get": { "tags": ["albums"], "summary": "Get photos for a specific album", "parameters": [ { "name": "id", "in": "path", "description": "post id", "required": true, "type": "integer" } ], "responses": { "200": { "description": "successful operation", "schema": { "type": "array", "items": { "$ref": "#/definitions/Photo" } } }, "404": { "description": "not found", "schema": { "$ref": "#/definitions/NotFoundError" } } } } }, "/photos": { "get": { "tags": ["photos"], "operationId": "getPhotos", "summary": "Get all available photos", "parameters": [ { "name": "id", "in": "query", "type": "integer", "description": "Filter by photo ID", "required": false }, { "name": "albumId", "in": "query", "type": "integer", "description": "Filter by album ID", "required": false } ], "produces": ["application/json"], "responses": { "200": { "description": "successful operation", "schema": { "type": "array", "items": { "$ref": "#/definitions/Photo" } } } } } }, "/photos/{id}": { "get": { "tags": ["photos"], "operationId": "getPhoto", "summary": "Get specific photo", "parameters": [ { "name": "id", "in": "path", "description": "The ID of the photo to retrieve", "required": true, "type": "integer" } ], "responses": { "200": { "description": "successful operation", "schema": { "$ref": "#/definitions/Photo" } }, "404": { "description": "not found", "schema": { "$ref": "#/definitions/NotFoundError" } } } } }, "/todos": { "get": { "tags": ["todos"], "operationId": "getTodos", "summary": "Get all available todos", "parameters": [ { "name": "id", "in": "query", "type": "integer", "description": "Filter by todo ID", "required": false }, { "name": "userId", "in": "query", "type": "integer", "description": "Filter by user ID", "required": false } ], "produces": ["application/json"], "responses": { "200": { "description": "successful operation", "schema": { "type": "array", "items": { "$ref": "#/definitions/Todo" } } } } } }, "/todos/{id}": { "get": { "tags": ["todos"], "operationId": "getTodo", "summary": "Get specific todo", "parameters": [ { "name": "id", "in": "path", "description": "The ID of the todo to retrieve", "required": true, "type": "integer" } ], "responses": { "200": { "description": "successful operation", "schema": { "$ref": "#/definitions/Todo" } }, "404": { "description": "not found", "schema": { "$ref": "#/definitions/NotFoundError" } } } } }, "/users": { "get": { "tags": ["users"], "operationId": "getUsers", "summary": "Get all available users", "parameters": [ { "name": "id", "in": "query", "type": "integer", "description": "Filter by user ID", "required": false }, { "name": "email", "in": "query", "type": "integer", "description": "Filter by user email address", "required": false } ], "produces": ["application/json"], "responses": { "200": { "description": "successful operation", "schema": { "type": "array", "items": { "$ref": "#/definitions/User" } } } } } }, "/users/{id}": { "get": { "tags": ["users"], "operationId": "getUser", "summary": "Get specific user", "parameters": [ { "name": "id", "in": "path", "description": "The ID of the user to retrieve", "required": true, "type": "integer" } ], "responses": { "200": { "description": "successful operation", "schema": { "$ref": "#/definitions/User" } }, "404": { "description": "not found", "schema": { "$ref": "#/definitions/NotFoundError" } } } } } }, "definitions": { "Post": { "type": "object", "properties": { "id": { "type": "integer", "format": "int64" }, "userId": { "type": "integer", "format": "int64" }, "title": { "type": "string" }, "body": { "type": "string" } } }, "Comment": { "type": "object", "properties": { "id": { "type": "integer", "format": "int64" }, "postId": { "type": "integer", "format": "int64" }, "name": { "type": "string" }, "email": { "type": "string", "format": "email" }, "body": { "type": "string" } } }, "Album": { "type": "object", "properties": { "id": { "type": "integer", "format": "int64" }, "userId": { "type": "integer", "format": "int64" }, "title": { "type": "string" } } }, "Photo": { "type": "object", "properties": { "id": { "type": "integer", "format": "int64" }, "albumId": { "type": "integer", "format": "int64" }, "title": { "type": "string" }, "url": { "type": "string", "format": "uri" }, "thumbnailUrl": { "type": "string", "format": "uri" } } }, "Todo": { "type": "object", "properties": { "id": { "type": "integer", "format": "int64" }, "userId": { "type": "integer", "format": "int64" }, "title": { "type": "string" }, "completed": { "type": "boolean" } } }, "User": { "type": "object", "properties": { "id": { "type": "integer", "format": "int64" }, "name": { "type": "string" }, "username": { "type": "string" }, "email": { "type": "string", "format": "email" }, "phone": { "type": "string" }, "website": { "type": "string" }, "company": { "type": "object", "properties": { "name": { "type": "string" }, "catchPhrase": { "type": "string" }, "bs": { "type": "string" } } }, "address": { "type": "object", "properties": { "street": { "type": "string" }, "suite": { "type": "string" }, "city": { "type": "string" }, "zipcode": { "type": "string" }, "geo": { "type": "object", "properties": { "lat": { "type": "string" }, "lng": { "type": "string" } } } } } } }, "NotFoundError": { "type": "object" } } }