-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
1,010 additions
and
329 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,253 @@ | ||
/articles/{slug}: | ||
get: | ||
summary: Gets a a particular article | ||
description: > | ||
Get a information about a specific article | ||
tags: | ||
- Article | ||
produces: | ||
- application/json | ||
parameters: | ||
- name: x-access-token | ||
in: header | ||
schema: | ||
type: string | ||
required: | ||
- authorization | ||
- name: slug | ||
in: path | ||
description: Slug for article | ||
type: string | ||
required: true | ||
responses: | ||
200: | ||
description: OK | ||
schema: | ||
$ref: '#definitions/Article' | ||
patch: | ||
summary: Updates an article | ||
description: > | ||
updates a specific article | ||
tags: | ||
- Article | ||
produces: | ||
- application/json | ||
parameters: | ||
- name: x-access-token | ||
in: header | ||
schema: | ||
type: string | ||
required: | ||
- authorization | ||
- name: articleSlug | ||
in: path | ||
description: Slug for article being updated | ||
type: string | ||
required: true | ||
- name: article | ||
in: body | ||
description: article new data | ||
schema: | ||
$ref: '#definitions/Article' | ||
responses: | ||
200: | ||
description: Article successfully updated | ||
schema: | ||
$ref: '#definitions/Article' | ||
400: | ||
$ref: '#responses/BadRequest' | ||
delete: | ||
summary: delete a specific article | ||
tags: | ||
- Article | ||
description: > | ||
deletes a particular article | ||
produces: | ||
- application/json | ||
parameters: | ||
- name: x-access-token | ||
in: header | ||
schema: | ||
type: string | ||
required: | ||
- authorization | ||
- name: slug | ||
in: path | ||
description: Slug for article being deleted | ||
type: string | ||
required: true | ||
responses: | ||
200: | ||
description: Article successfully deleted | ||
schema: | ||
$ref: '#definitions/Article' | ||
400: | ||
$ref: '#/responses/BadRequest' | ||
404: | ||
$ref: '#/responses/Notfound' | ||
/articles: | ||
post: | ||
summary: Create an article | ||
description: > | ||
Creates a specific article | ||
tags: | ||
- Article | ||
produces: | ||
- application/json | ||
consumes: | ||
- multipart/form-data | ||
parameters: | ||
- name: x-access-token | ||
in: header | ||
schema: | ||
type: string | ||
required: | ||
- authorization | ||
- name: slug | ||
in: formData | ||
type: string | ||
description: slug | ||
- name: title | ||
in: formData | ||
type: string | ||
description: title | ||
- name: description | ||
in: formData | ||
type: string | ||
description: description | ||
- name: body | ||
in: formData | ||
type: string | ||
description: body | ||
- name: tagList | ||
in: formData | ||
type: string | ||
description: tagList | ||
- name: favorited | ||
in: formData | ||
type: string | ||
description: favorited | ||
- name: favoritesCount | ||
in: formData | ||
type: string | ||
description: favoritesCount | ||
- name: image | ||
in: formData | ||
type: file | ||
description: image | ||
- name: author | ||
type: object | ||
properties: | ||
username: | ||
type: string | ||
bio: | ||
type: string | ||
image: | ||
type: string | ||
following: | ||
type: boolean | ||
description: Article's author details | ||
responses: | ||
200: | ||
description: Article successfully created | ||
schema: | ||
$ref: '#definitions/Article' | ||
400: | ||
$ref: '#responses/BadRequest' | ||
404: | ||
$ref: '#/responses/Notfound' | ||
get: | ||
summary: Gets all articles | ||
description: > | ||
Get a information about a all articles | ||
tags: | ||
- Article | ||
produces: | ||
- application/json | ||
parameters: | ||
- name: x-access-token | ||
in: header | ||
schema: | ||
type: string | ||
required: | ||
- authorization | ||
responses: | ||
200: | ||
description: OK | ||
schema: | ||
$ref: '#definitions/Article' | ||
404: | ||
$ref: '#/responses/Notfound' | ||
tags: | ||
- name: Article | ||
description: Operations related to Article | ||
responses: | ||
success: | ||
description: Success | ||
schema: | ||
$ref: '#/definitions/Article' | ||
BadRequest: | ||
description: Bad request | ||
schema: | ||
$ref: '#/definitions/Error' | ||
Notfound: | ||
description: Not found | ||
schema: | ||
$ref: '#/definitions/Error' | ||
definitions: | ||
Article: | ||
type: object | ||
properties: | ||
slug: | ||
type: string | ||
description: article slug | ||
title: | ||
type: string | ||
description: article title | ||
description: | ||
type: string | ||
description: article description | ||
body: | ||
type: string | ||
description: article body | ||
taglist: | ||
type: array | ||
items: | ||
type: string | ||
description: article tags | ||
favorited: | ||
type: boolean | ||
description: is article favorited | ||
favoritesCount: | ||
type: integer | ||
description: article tags | ||
author: | ||
type: object | ||
properties: | ||
username: | ||
type: string | ||
bio: | ||
type: string | ||
image: | ||
type: string | ||
following: | ||
type: boolean | ||
description: Article's author details | ||
required: | ||
- slug | ||
- title | ||
- description | ||
- body | ||
- tagList | ||
- favorited | ||
- favoritesCount | ||
- author | ||
Error: | ||
type: object | ||
properties: | ||
status: | ||
type: string | ||
description: status code | ||
message: | ||
type: string | ||
description: description of error |
Oops, something went wrong.