Last active
March 3, 2023 18:08
-
-
Save ericpsimon/71899d0564e928fd1a9a7b2eca22ce31 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" | |
/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" | |
Post: | |
"type": "object" | |
"required": | |
- "id" | |
- "userId" | |
- "title" | |
- "completed" | |
"properties": | |
id: | |
type: "integer" | |
userId: | |
type: "integer" | |
title: | |
type: "string" | |
completed: | |
type: "string" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment