Skip to content

Instantly share code, notes, and snippets.

@amessinger
Created January 29, 2019 14:25
Show Gist options
  • Save amessinger/07438d30614fd498e693c5138f39ab5a to your computer and use it in GitHub Desktop.
Save amessinger/07438d30614fd498e693c5138f39ab5a to your computer and use it in GitHub Desktop.
initiative openapi desc
openapi: 3.0.0
# Added by API Auto Mocking Plugin
servers:
- description: SwaggerHub API Auto Mocking
url: https://virtserver.swaggerhub.com/traquenard/initiative/1.0.0
info:
description: This is a the api for the initiative project
version: "1.0.0"
title: Initiative API
contact:
email: [email protected]
license:
name: Apache 2.0
url: 'http://www.apache.org/licenses/LICENSE-2.0.html'
tags:
- name: admins
description: Secured Admin-only calls
- name: developers
description: Operations available to regular developers
paths:
/rpg:
get:
tags:
- developers
summary: searches rpg
operationId: searchRPG
description: |
By passing in the appropriate options, you can search for
available rpg in the system
parameters:
- in: query
name: searchString
description: pass an optional search string for looking up inventory
required: false
schema:
type: string
- in: query
name: skip
description: number of records to skip for pagination
schema:
type: integer
format: int32
minimum: 0
- in: query
name: limit
description: maximum number of records to return
schema:
type: integer
format: int32
minimum: 0
maximum: 50
responses:
'200':
description: search results matching criteria
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/RpgItem'
'400':
description: bad input parameter
post:
tags:
- admins
summary: adds an rpg item
operationId: addRpg
description: Adds an item to the system
responses:
'201':
description: item created
'400':
description: 'invalid input, object invalid'
'409':
description: an existing item already exists
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/RpgItem'
description: rpg item to add
/character:
get:
tags:
- developers
summary: searches characters
operationId: searchCharacters
description: |
By passing in the appropriate options, you can search for
available characters in the system
parameters:
- in: query
name: searchString
description: pass an optional search string for looking up inventory
required: false
schema:
type: string
- in: query
name: skip
description: number of records to skip for pagination
schema:
type: integer
format: int32
minimum: 0
- in: query
name: limit
description: maximum number of records to return
schema:
type: integer
format: int32
minimum: 0
maximum: 50
responses:
'200':
description: search results matching criteria
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/RpgItem'
'400':
description: bad input parameter
post:
tags:
- admins
summary: adds an character item
operationId: addCharacter
description: Adds an item to the system
responses:
'201':
description: item created
'400':
description: 'invalid input, object invalid'
'409':
description: an existing item already exists
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/CharacterItem'
description: character item to add
components:
schemas:
RpgItem:
type: object
required:
- id
- name
- powerName
- initiativeRange
properties:
id:
type: string
format: int
example: 12
name:
type: string
example: 'Qin'
powerName:
type: string
example: 'Chi'
initiativeMax:
type: string
format: int
example: 15
CharacterItem:
type: object
required:
- id
- name
- rpgId
- action
- actualAction
- power
- actualPower
- wait
- friend
properties:
id:
type: string
format: int
example: 12
name:
type: string
example: 'HNK'
action:
type: string
format: int
example: 5
actualAction:
type: string
format: int
example: 1
power:
type: string
format: int
example: 80
actualPower:
type: string
format: int
example: 56
wait:
type: boolean
friend:
type: boolean
rpgId:
$ref: '#/components/schemas/RpgItem'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment