Last active
March 5, 2023 09:50
-
-
Save EDDYMENS/f7aa590591e618c690601bead7ef9287 to your computer and use it in GitHub Desktop.
Reqres Open API Spec
This file contains hidden or 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.3", | |
"info": { | |
"title": "SDK example - OpenAPI 3.0", | |
"description": "This spec is meant to demonstrate how to use the SDK generator by readme.io", | |
"version": "1.0.11" | |
}, | |
"servers": [ | |
{ | |
"url": "https://reqres.in/api" | |
} | |
], | |
"tags": [ | |
{ | |
"name": "Test" | |
} | |
], | |
"paths": { | |
"/users": { | |
"post": { | |
"tags": [ | |
"Test" | |
], | |
"summary": "Add a new user", | |
"description": "Add a new user", | |
"operationId": "addUser", | |
"requestBody": { | |
"description": "Create a new pet in the store", | |
"content": { | |
"application/json": { | |
"schema": { | |
"$ref": "#/components/schemas/userRequest" | |
} | |
} | |
}, | |
"required": true | |
}, | |
"responses": { | |
"200": { | |
"description": "Successful operation", | |
"content": { | |
"application/json": { | |
"schema": { | |
"$ref": "#/components/schemas/userResponse" | |
} | |
} | |
} | |
} | |
} | |
}, | |
"get": { | |
"tags": [ | |
"Test" | |
], | |
"summary": "Return a list of users", | |
"description": "Return a list of users", | |
"operationId": "getUsers", | |
"parameters": [ | |
{ | |
"name": "page", | |
"in": "query", | |
"description": "Select the portition of record you want back", | |
"required": false, | |
"schema": { | |
"type": "integer", | |
"example": 1 | |
} | |
} | |
], | |
"responses": { | |
"200": { | |
"description": "successful operation", | |
"content": { | |
"application/json": { | |
"schema": { | |
"type": "array", | |
"items": { | |
"$ref": "#/components/schemas/userResponse" | |
} | |
} | |
} | |
} | |
} | |
} | |
} | |
}, | |
"/users/{id}": { | |
"put": { | |
"tags": [ | |
"Test" | |
], | |
"summary": "Update an existing user", | |
"description": "Update an existing user by Id", | |
"operationId": "updateUser", | |
"parameters": [ | |
{ | |
"name": "id", | |
"in": "path", | |
"description": "id of user to delete", | |
"required": true, | |
"example": 1, | |
"schema": { | |
"type": "integer", | |
"format": "int64" | |
} | |
} | |
], | |
"requestBody": { | |
"description": "Update an existent pet in the store", | |
"content": { | |
"application/json": { | |
"schema": { | |
"$ref": "#/components/schemas/userRequest" | |
} | |
} | |
}, | |
"required": true | |
}, | |
"responses": { | |
"200": { | |
"description": "Successful operation", | |
"content": { | |
"application/json": { | |
"schema": { | |
"$ref": "#/components/schemas/userResponse" | |
} | |
} | |
} | |
} | |
} | |
}, | |
"delete": { | |
"tags": [ | |
"Test" | |
], | |
"summary": "Deletes a user", | |
"description": "delete a user", | |
"operationId": "deleteUser", | |
"parameters": [ | |
{ | |
"name": "id", | |
"in": "path", | |
"description": "id of user to delete", | |
"required": true, | |
"example": 1, | |
"schema": { | |
"type": "integer", | |
"format": "int64" | |
} | |
} | |
], | |
"responses": { | |
"204": { | |
"description": "No content" | |
} | |
} | |
} | |
} | |
}, | |
"components": { | |
"schemas": { | |
"userResponse": { | |
"description": "response payload" | |
}, | |
"userRequest": { | |
"type": "object", | |
"properties": { | |
"name": { | |
"type": "string", | |
"example": "morpheus" | |
}, | |
"job": { | |
"type": "string", | |
"example": "leader" | |
} | |
} | |
} | |
} | |
} | |
} |
This file contains hidden or 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.3 | |
info: | |
title: SDK example - OpenAPI 3.0 | |
description: |- | |
This spec is meant to demonstrate how to use the SDK generator by readme.io | |
version: 1.0.11 | |
servers: | |
- url: https://reqres.in/api | |
tags: | |
- name: Test | |
paths: | |
/users: | |
post: | |
tags: | |
- Test | |
summary: Add a new user | |
description: Add a new user | |
operationId: addUser | |
requestBody: | |
description: Create a new pet in the store | |
content: | |
application/json: | |
schema: | |
$ref: '#/components/schemas/userRequest' | |
required: true | |
responses: | |
'200': | |
description: Successful operation | |
content: | |
application/json: | |
schema: | |
$ref: '#/components/schemas/userResponse' | |
get: | |
tags: | |
- Test | |
summary: Return a list of users | |
description: Return a list of users | |
operationId: getUsers | |
parameters: | |
- name: page | |
in: query | |
description: Select the portition of record you want back | |
required: false | |
schema: | |
type: integer | |
example: 1 | |
responses: | |
'200': | |
description: successful operation | |
content: | |
application/json: | |
schema: | |
type: array | |
items: | |
$ref: '#/components/schemas/userResponse' | |
/users/{id}: | |
put: | |
tags: | |
- Test | |
summary: Update an existing user | |
description: Update an existing user by Id | |
operationId: updateUser | |
parameters: | |
- name: id | |
in: path | |
description: id of user to delete | |
required: true | |
example: 1 | |
schema: | |
type: integer | |
format: int64 | |
requestBody: | |
description: Update an existent pet in the store | |
content: | |
application/json: | |
schema: | |
$ref: '#/components/schemas/userRequest' | |
required: true | |
responses: | |
'200': | |
description: Successful operation | |
content: | |
application/json: | |
schema: | |
$ref: '#/components/schemas/userResponse' | |
delete: | |
tags: | |
- Test | |
summary: Deletes a user | |
description: delete a user | |
operationId: deleteUser | |
parameters: | |
- name: id | |
in: path | |
description: id of user to delete | |
required: true | |
example: 1 | |
schema: | |
type: integer | |
format: int64 | |
responses: | |
'204': | |
description: No content | |
components: | |
schemas: | |
userResponse: | |
description: response payload | |
userRequest: | |
type: object | |
properties: | |
name: | |
type: string | |
example: "morpheus" | |
job: | |
type: string | |
example: "leader" | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment