mirror of
https://github.com/notherealmarco/WASAPhoto.git
synced 2025-03-14 14:16:15 +01:00
Merge branch 'api_dev' into dev
This commit is contained in:
commit
23fcdf6227
1 changed files with 122 additions and 27 deletions
149
doc/api.yaml
149
doc/api.yaml
|
@ -4,9 +4,9 @@ info:
|
||||||
description: |-
|
description: |-
|
||||||
Keep in touch with your friends by sharing photos of special moments, thanks to WASAPhoto! You can
|
Keep in touch with your friends by sharing photos of special moments, thanks to WASAPhoto! You can
|
||||||
upload your photos directly from your PC, and they will be visible to everyone following you.
|
upload your photos directly from your PC, and they will be visible to everyone following you.
|
||||||
version: "2.0.0"
|
version: "3.0"
|
||||||
tags:
|
tags:
|
||||||
- name: login
|
- name: logins
|
||||||
description: Login API
|
description: Login API
|
||||||
- name: username
|
- name: username
|
||||||
description: Operations related to username
|
description: Operations related to username
|
||||||
|
@ -145,6 +145,7 @@ paths:
|
||||||
schema:
|
schema:
|
||||||
type: array
|
type: array
|
||||||
minItems: 0
|
minItems: 0
|
||||||
|
maxItems: 100
|
||||||
description: The list of users that the user is following.
|
description: The list of users that the user is following.
|
||||||
items:
|
items:
|
||||||
$ref: "#/components/schemas/uid_name"
|
$ref: "#/components/schemas/uid_name"
|
||||||
|
@ -324,6 +325,18 @@ paths:
|
||||||
$ref: "#/components/schemas/photo_id"
|
$ref: "#/components/schemas/photo_id"
|
||||||
required: true
|
required: true
|
||||||
description: The ID of the photo.
|
description: The ID of the photo.
|
||||||
|
- name: limit
|
||||||
|
in: query
|
||||||
|
schema:
|
||||||
|
$ref: "#/components/schemas/limit"
|
||||||
|
description: The number of elements to show.
|
||||||
|
required: false
|
||||||
|
- name: start_index
|
||||||
|
in: query
|
||||||
|
schema:
|
||||||
|
$ref: "#/components/schemas/start_index"
|
||||||
|
description: The starting offset.
|
||||||
|
required: false
|
||||||
responses:
|
responses:
|
||||||
'200':
|
'200':
|
||||||
description: Returns the user list
|
description: Returns the user list
|
||||||
|
@ -332,6 +345,7 @@ paths:
|
||||||
schema:
|
schema:
|
||||||
type: array
|
type: array
|
||||||
minItems: 0
|
minItems: 0
|
||||||
|
maxItems: 100
|
||||||
description: An array of users liking the photo.
|
description: An array of users liking the photo.
|
||||||
items:
|
items:
|
||||||
$ref: "#/components/schemas/uid_name"
|
$ref: "#/components/schemas/uid_name"
|
||||||
|
@ -448,13 +462,7 @@ paths:
|
||||||
username: "Maria"
|
username: "Maria"
|
||||||
followers: 25
|
followers: 25
|
||||||
following: 32
|
following: 32
|
||||||
photos:
|
photos: 50
|
||||||
- photo_id: 2341
|
|
||||||
upload_time: "2020-11-20T12:00:00Z"
|
|
||||||
likes: 2
|
|
||||||
- photo_id: 2342
|
|
||||||
upload_time: "2022-10-23T12:01:00Z"
|
|
||||||
likes: 5
|
|
||||||
'404':
|
'404':
|
||||||
description: User not found (or the authorized user is banned).
|
description: User not found (or the authorized user is banned).
|
||||||
content:
|
content:
|
||||||
|
@ -465,6 +473,58 @@ paths:
|
||||||
error: "Resource not found"
|
error: "Resource not found"
|
||||||
|
|
||||||
/users/{user_id}/photos:
|
/users/{user_id}/photos:
|
||||||
|
parameters:
|
||||||
|
- name: user_id
|
||||||
|
in: path
|
||||||
|
schema:
|
||||||
|
$ref: "#/components/schemas/uid"
|
||||||
|
required: true
|
||||||
|
description: The user ID of the user who uploads the photo.
|
||||||
|
|
||||||
|
get:
|
||||||
|
tags: ["photos"]
|
||||||
|
summary: Returns user photos
|
||||||
|
description: Returns the list of photos uploaded by a user.
|
||||||
|
operationId: getUserPhotos
|
||||||
|
security:
|
||||||
|
- BearerAuth: []
|
||||||
|
parameters:
|
||||||
|
- name: limit
|
||||||
|
in: query
|
||||||
|
schema:
|
||||||
|
$ref: "#/components/schemas/limit"
|
||||||
|
description: The number of elements to show.
|
||||||
|
required: false
|
||||||
|
- name: start_index
|
||||||
|
in: query
|
||||||
|
schema:
|
||||||
|
$ref: "#/components/schemas/start_index"
|
||||||
|
description: The starting offset.
|
||||||
|
required: false
|
||||||
|
responses:
|
||||||
|
'200':
|
||||||
|
description: Returns the user photos list
|
||||||
|
content:
|
||||||
|
application/json:
|
||||||
|
schema:
|
||||||
|
$ref: "#/components/schemas/user_photo_stream"
|
||||||
|
'404':
|
||||||
|
description: User not found (or the authorized user is banned).
|
||||||
|
content:
|
||||||
|
application/json:
|
||||||
|
schema:
|
||||||
|
$ref: "#/components/schemas/generic_response"
|
||||||
|
example:
|
||||||
|
error: "Resource not found"
|
||||||
|
'400':
|
||||||
|
description: Bad request, there is an error in one of the parameters.
|
||||||
|
content:
|
||||||
|
application/json:
|
||||||
|
schema:
|
||||||
|
$ref: "#/components/schemas/generic_response"
|
||||||
|
example:
|
||||||
|
error: "Invalid limit or start_index"
|
||||||
|
|
||||||
post:
|
post:
|
||||||
tags: ["photos"]
|
tags: ["photos"]
|
||||||
summary: Uploads a photo
|
summary: Uploads a photo
|
||||||
|
@ -472,13 +532,6 @@ paths:
|
||||||
operationId: uploadPhoto
|
operationId: uploadPhoto
|
||||||
security:
|
security:
|
||||||
- BearerAuth: []
|
- BearerAuth: []
|
||||||
parameters:
|
|
||||||
- name: user_id
|
|
||||||
in: path
|
|
||||||
schema:
|
|
||||||
$ref: "#/components/schemas/uid"
|
|
||||||
required: true
|
|
||||||
description: The user ID of the user who uploads the photo.
|
|
||||||
requestBody:
|
requestBody:
|
||||||
content:
|
content:
|
||||||
image/jpeg:
|
image/jpeg:
|
||||||
|
@ -589,6 +642,19 @@ paths:
|
||||||
summary: Gets photo comments
|
summary: Gets photo comments
|
||||||
description: Gets the list of comments of a photo
|
description: Gets the list of comments of a photo
|
||||||
operationId: getPhotoComments
|
operationId: getPhotoComments
|
||||||
|
parameters:
|
||||||
|
- name: limit
|
||||||
|
in: query
|
||||||
|
schema:
|
||||||
|
$ref: "#/components/schemas/limit"
|
||||||
|
description: The number of elements to show.
|
||||||
|
required: false
|
||||||
|
- name: start_index
|
||||||
|
in: query
|
||||||
|
schema:
|
||||||
|
$ref: "#/components/schemas/start_index"
|
||||||
|
description: The starting offset.
|
||||||
|
required: false
|
||||||
security:
|
security:
|
||||||
- BearerAuth: []
|
- BearerAuth: []
|
||||||
responses:
|
responses:
|
||||||
|
@ -703,15 +769,13 @@ paths:
|
||||||
- name: limit
|
- name: limit
|
||||||
in: query
|
in: query
|
||||||
schema:
|
schema:
|
||||||
type: integer
|
$ref: "#/components/schemas/limit"
|
||||||
default: 25
|
|
||||||
description: The number of elements to show.
|
description: The number of elements to show.
|
||||||
required: false
|
required: false
|
||||||
- name: start_index
|
- name: start_index
|
||||||
in: query
|
in: query
|
||||||
schema:
|
schema:
|
||||||
type: integer
|
$ref: "#/components/schemas/start_index"
|
||||||
default: 0
|
|
||||||
description: The starting offset.
|
description: The starting offset.
|
||||||
required: false
|
required: false
|
||||||
responses:
|
responses:
|
||||||
|
@ -723,12 +787,12 @@ paths:
|
||||||
$ref: "#/components/schemas/photo_stream"
|
$ref: "#/components/schemas/photo_stream"
|
||||||
example:
|
example:
|
||||||
- user_id: "1a2b3c4d-5e6f-7a8b-9c0d-1e2f3a4b5c6d"
|
- user_id: "1a2b3c4d-5e6f-7a8b-9c0d-1e2f3a4b5c6d"
|
||||||
- username: "Federicus"
|
username: "Federicus"
|
||||||
- photo_id: 1520
|
photo_id: 157
|
||||||
- upload_time: "2020-11-20T12:00:00Z"
|
upload_time: "2020-11-20T12:00:00Z"
|
||||||
- likes: 93
|
likes: 93
|
||||||
|
comments: 13
|
||||||
|
liked: true
|
||||||
|
|
||||||
components:
|
components:
|
||||||
securitySchemes:
|
securitySchemes:
|
||||||
|
@ -737,6 +801,14 @@ components:
|
||||||
scheme: bearer
|
scheme: bearer
|
||||||
|
|
||||||
schemas:
|
schemas:
|
||||||
|
start_index:
|
||||||
|
type: integer
|
||||||
|
description: The starting offset.
|
||||||
|
default: 0
|
||||||
|
limit:
|
||||||
|
type: integer
|
||||||
|
description: The number of elements to show.
|
||||||
|
default: 15
|
||||||
uid_name:
|
uid_name:
|
||||||
type: object
|
type: object
|
||||||
properties:
|
properties:
|
||||||
|
@ -786,6 +858,10 @@ components:
|
||||||
type: integer
|
type: integer
|
||||||
example: 90
|
example: 90
|
||||||
description: Number of likes.
|
description: Number of likes.
|
||||||
|
comments_n:
|
||||||
|
type: integer
|
||||||
|
example: 7
|
||||||
|
description: Number of comments on the photo.
|
||||||
followers_n:
|
followers_n:
|
||||||
type: integer
|
type: integer
|
||||||
example: 420
|
example: 420
|
||||||
|
@ -794,6 +870,14 @@ components:
|
||||||
type: integer
|
type: integer
|
||||||
example: 69
|
example: 69
|
||||||
description: Number of following users.
|
description: Number of following users.
|
||||||
|
liked_boolean:
|
||||||
|
type: boolean
|
||||||
|
example: true
|
||||||
|
description: Whether the user liked the photo.
|
||||||
|
photos_n:
|
||||||
|
type: integer
|
||||||
|
example: 90
|
||||||
|
description: Number of photos.
|
||||||
user_profile:
|
user_profile:
|
||||||
type: object
|
type: object
|
||||||
description: The profile of the user.
|
description: The profile of the user.
|
||||||
|
@ -805,10 +889,11 @@ components:
|
||||||
following:
|
following:
|
||||||
$ref: "#/components/schemas/following_n"
|
$ref: "#/components/schemas/following_n"
|
||||||
photos:
|
photos:
|
||||||
$ref: "#/components/schemas/user_photo_stream"
|
$ref: "#/components/schemas/photos_n"
|
||||||
user_photo_stream:
|
user_photo_stream:
|
||||||
type: array
|
type: array
|
||||||
minItems: 0
|
minItems: 0
|
||||||
|
maxItems: 100
|
||||||
description: An array of photos, upload time and likes.
|
description: An array of photos, upload time and likes.
|
||||||
items:
|
items:
|
||||||
$ref: "#/components/schemas/user_photo_stream_item"
|
$ref: "#/components/schemas/user_photo_stream_item"
|
||||||
|
@ -821,9 +906,14 @@ components:
|
||||||
$ref: "#/components/schemas/upload_time"
|
$ref: "#/components/schemas/upload_time"
|
||||||
likes:
|
likes:
|
||||||
$ref: "#/components/schemas/likes"
|
$ref: "#/components/schemas/likes"
|
||||||
|
comments:
|
||||||
|
$ref: "#/components/schemas/comments_n"
|
||||||
|
liked:
|
||||||
|
$ref: "#/components/schemas/liked_boolean"
|
||||||
photo_stream:
|
photo_stream:
|
||||||
type: array
|
type: array
|
||||||
minItems: 0
|
minItems: 0
|
||||||
|
maxItems: 100
|
||||||
description: An array of photos, author, upload time and likes.
|
description: An array of photos, author, upload time and likes.
|
||||||
items:
|
items:
|
||||||
$ref: "#/components/schemas/photo_stream_item"
|
$ref: "#/components/schemas/photo_stream_item"
|
||||||
|
@ -840,9 +930,14 @@ components:
|
||||||
$ref: "#/components/schemas/upload_time"
|
$ref: "#/components/schemas/upload_time"
|
||||||
likes:
|
likes:
|
||||||
$ref: "#/components/schemas/likes"
|
$ref: "#/components/schemas/likes"
|
||||||
|
comments:
|
||||||
|
$ref: "#/components/schemas/comments_n"
|
||||||
|
liked:
|
||||||
|
$ref: "#/components/schemas/liked_boolean"
|
||||||
comments:
|
comments:
|
||||||
type: array
|
type: array
|
||||||
minItems: 0
|
minItems: 0
|
||||||
|
maxItems: 100
|
||||||
description: An array of comments.
|
description: An array of comments.
|
||||||
items:
|
items:
|
||||||
$ref : "#/components/schemas/comment_item"
|
$ref : "#/components/schemas/comment_item"
|
||||||
|
|
Loading…
Reference in a new issue