generated from userver-framework/service_template
-
Notifications
You must be signed in to change notification settings - Fork 5
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
35 changed files
with
360 additions
and
241 deletions.
There are no files selected for viewing
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,225 @@ | ||
openapi: 3.0.0 | ||
info: | ||
title: realmedium_sample 1.0 | ||
description: a backend application built with userver framework | ||
version: 1.0.0 | ||
servers: | ||
- url: localhost:8080 | ||
description: local | ||
|
||
paths: | ||
# /api/profiles/{username}: | ||
# get: | ||
# description: Get user profile | ||
|
||
# /api/profiles/{username}/follow: | ||
# post: | ||
# description: Follow user | ||
# delete: | ||
# description: Unfollow user | ||
|
||
/api/user: | ||
# get: | ||
# description: Get user profile | ||
put: | ||
description: Update user profile | ||
requestBody: | ||
content: | ||
application/json: | ||
schema: | ||
$ref: '#/components/schemas/UserUpdateDTO' | ||
responses: | ||
'200': | ||
description: User profile successfully updated | ||
|
||
/api/users: | ||
post: | ||
description: Register user | ||
requestBody: | ||
content: | ||
application/json: | ||
schema: | ||
$ref: '#/components/schemas/UserRegistrationDTO' | ||
responses: | ||
'200': | ||
description: Successfully registered | ||
|
||
/api/users/login: | ||
post: | ||
description: Login user | ||
requestBody: | ||
content: | ||
application/json: | ||
schema: | ||
$ref: '#/components/schemas/UserLoginDTO' | ||
responses: | ||
'200': | ||
description: Successfully logged in | ||
|
||
/api/articles: | ||
# get: | ||
# description: Get list of articles | ||
post: | ||
description: Create article | ||
requestBody: | ||
content: | ||
application/json: | ||
schema: | ||
$ref: '#/components/schemas/CreateArticleRequest' | ||
responses: | ||
'200': | ||
description: Successfully created article | ||
|
||
/api/articles/{slug}: | ||
# get: | ||
# description: Get an article | ||
put: | ||
description: Update article | ||
requestBody: | ||
content: | ||
application/json: | ||
schema: | ||
$ref: '#/components/schemas/UpdateArticleRequest' | ||
responses: | ||
'200': | ||
description: Successfully updated article | ||
# delete: | ||
# description: Delete article | ||
|
||
/api/articles/{slug}/favorite: | ||
# post: | ||
# description: Make an article favorite | ||
# delete: | ||
# description: Remove an article from favorites | ||
|
||
/api/articles/{slug}/comments: | ||
post: | ||
description: Add comment | ||
parameters: | ||
- name: slug | ||
in: path | ||
required: true | ||
schema: | ||
type: string | ||
responses: | ||
'200': | ||
description: Comment successfully added | ||
requestBody: | ||
content: | ||
application/json: | ||
schema: | ||
$ref: '#/components/schemas/AddComment' | ||
# get: | ||
# description: Get comments list | ||
|
||
# /api/articles/{slug}/comments/{id}: | ||
# delete: | ||
# description: Delete comment | ||
|
||
components: | ||
schemas: | ||
UserLoginDTO: | ||
type: object | ||
additionalProperties: false | ||
properties: | ||
email: | ||
type: string | ||
password: | ||
type: string | ||
|
||
UserRegistrationDTO: | ||
type: object | ||
additionalProperties: false | ||
properties: | ||
username: | ||
type: string | ||
email: | ||
type: string | ||
password: | ||
type: string | ||
|
||
UserUpdateDTO: | ||
type: object | ||
additionalProperties: false | ||
properties: | ||
email: | ||
type: string | ||
username: | ||
type: string | ||
password: | ||
type: string | ||
bio: | ||
type: string | ||
image: | ||
type: string | ||
|
||
CreateArticleRequest: | ||
type: object | ||
additionalProperties: false | ||
properties: | ||
title: | ||
type: string | ||
description: | ||
type: string | ||
body: | ||
type: string | ||
tags: | ||
type: array | ||
items: | ||
type: string | ||
|
||
UpdateArticleRequest: | ||
type: object | ||
additionalProperties: false | ||
properties: | ||
title: | ||
type: string | ||
description: | ||
type: string | ||
body: | ||
type: string | ||
|
||
AddComment: | ||
type: object | ||
additionalProperties: false | ||
properties: | ||
body: | ||
type: string | ||
|
||
# Comment: | ||
|
||
# Article: | ||
|
||
# Profile: | ||
# type: object | ||
# additionalProperties: false | ||
# properties: | ||
# username: | ||
# type: string | ||
# bio: | ||
# type: string | ||
# image: | ||
# type: string | ||
# following: | ||
# type: boolean | ||
# required: | ||
# - username | ||
# - following | ||
|
||
# securitySchemes: | ||
# bearerAuth: | ||
# type: http | ||
# scheme: bearer | ||
# bearerFormat: JWT | ||
|
||
responses: | ||
UnauthorizedError: | ||
description: User is not authorized | ||
content: | ||
application/json: | ||
schema: | ||
type: object | ||
properties: | ||
error: | ||
type: string | ||
example: "Unauthorized" |
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
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
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
Oops, something went wrong.