Skip to content

Instantly share code, notes, and snippets.

@EDDYMENS
Last active March 5, 2023 09:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save EDDYMENS/f7aa590591e618c690601bead7ef9287 to your computer and use it in GitHub Desktop.
Save EDDYMENS/f7aa590591e618c690601bead7ef9287 to your computer and use it in GitHub Desktop.
Reqres Open API Spec
{
"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"
}
}
}
}
}
}
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