Skip to content

Instantly share code, notes, and snippets.

@juliuscanute
Created July 3, 2019 06:17
Show Gist options
  • Save juliuscanute/cbe2d42035896ec0b4118a1b586a7410 to your computer and use it in GitHub Desktop.
Save juliuscanute/cbe2d42035896ec0b4118a1b586a7410 to your computer and use it in GitHub Desktop.
Word to search
/v1/dictionary:
get:
tags:
- 'Query Dictionary'
parameters:
- name: word
in: query
required: true
description: Word to search
schema:
type: string
example: happy
- name: pageNo
in: query
required: true
description: Page Number
schema:
type: integer
example: 1
responses:
'200':
description: 'Success'
content:
application/json:
schema:
$ref: '#/components/schemas/SearchResult'
example:
startPage: 1
endPage: 2
totalRecords: 100
currentPage: 1
words:
- id: 1
word: Abarticulation
meaning: Articulation, usually that kind of articulation which admits of free motion in the joint; diarthrosis.
- id: 2
word: Abase
meaning: To cast down or reduce low or lower, as in rank, office, condition in life, or estimation of worthiness; to depress; to humble; to degrade.
'404':
description: 'Word not found'
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorMessage'
example:
message: 'No matching words found'
path: '/v1/dictionary?word=zzzzz&pageNo=1'
components:
SearchResult:
type: 'object'
properties:
startPage:
type: 'integer'
description: 'Start page number'
endPage:
type: 'integer'
description: 'End page number'
totalRecords:
type: 'integer'
description: 'Records per page'
currentPage:
type: 'integer'
description: 'Current page number'
words:
type: 'array'
items:
$ref: '#/components/schemas/Meaning'
Meaning:
type: 'object'
properties:
id:
type: 'integer'
description: 'Word ID'
word:
type: 'string'
description: 'Word'
meaning:
type: 'string'
description: 'Meaning of the word'
ErrorMessage:
type: 'object'
properties:
message:
type: 'string'
description: 'Description of the error'
path:
type: 'string'
description: 'Identity of the resource'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment