Chore: Swagger Docs V1 (#546)

This commit is contained in:
Sony Mathew
2020-02-23 12:54:29 +05:30
committed by GitHub
parent eea92bd0ac
commit e2688d5176
25 changed files with 739 additions and 0 deletions

View File

@@ -0,0 +1,18 @@
get:
tags: [Contact]
summary: Conversations
parameters:
- name: id
in: path
type: number
description: ID of contact
required: true
responses:
200:
description: Success
schema:
$ref: '#/definitions/contact_conversations'
404:
description: Contact not found
403:
description: Access denied

View File

@@ -0,0 +1,42 @@
get:
tags: [Contact]
summary: Show Contact
parameters:
- name: id
in: path
type: number
description: ID of contact
required: true
responses:
200:
description: Success
schema:
$ref: '#/definitions/extended_contact'
404:
description: Contact not found
403:
description: Access denied
put:
tags: [Contact]
summary: Update Contact
parameters:
- name: id
in: path
type: number
description: ID of the contact
required: true
- name: data
in: body
required: true
schema:
$ref: '#/definitions/contact_update'
responses:
204:
description: Success
schema:
$ref: '#/definitions/contact_base'
404:
description: Contact not found
403:
description: Access denied

View File

@@ -0,0 +1,36 @@
get:
tags: [Contact]
description: Listing all contacts with pagination
summary: List contacts
parameters:
- name: query_hash
in: query
type: string
responses:
200:
description: Success
schema:
$ref: '#/definitions/contact_list'
400:
description: Bad Request Error
schema:
$ref: '#/definitions/bad_request_error'
post:
tags: [Contact]
description: Create a contact
parameters:
- name: data
in: body
required: true
schema:
$ref: '#/definitions/contact_create'
responses:
200:
description: Success
schema:
$ref: '#/definitions/extended_contact'
400:
description: Bad Request Error
schema:
$ref: '#/definitions/bad_request_error'

7
swagger/paths/index.yml Normal file
View File

@@ -0,0 +1,7 @@
# Contacts
/contacts:
$ref: ./contact/list_create.yml
/contacts/{id}:
$ref: ./contact/crud.yml
/contacts/{id}/conversations:
$ref: ./contact/conversations.yml