forked from Benjamin-Code-YouTube/boumboum-back
-
Notifications
You must be signed in to change notification settings - Fork 4
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
1 parent
6b894c4
commit feaa7c8
Showing
1 changed file
with
346 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,346 @@ | ||
{"openapi":"3.0.0","info":{"title":"Application with swagger docs","version":"1.0.0","description":"My application with swagger docs"},"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT"}},"schemas":{"SerializedTrack":{"type":"object","properties":{"uri":{"type":"string"},"popularity":{"type":"number"},"name":{"type":"string"},"trackId":{"type":"string"},"album":{"type":"string"},"image":{"type":"object","properties":{"height":{"type":"number"},"url":{"type":"string"},"width":{"type":"number"}}},"artistName":{"type":"string"}}},"ProfileToShow":{"type":"object","properties":{"user":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/User/properties/id"},"name":{"$ref":"#/components/schemas/User/properties/name"},"image":{"type":"string"}}},"songs":{"type":"array","items":{"$ref":"#/components/schemas/Track"}}}},"SerializedUser":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"email":{"type":"string"},"dateOfBirth":{"type":"string","format":"date-time"},"description":{"type":"string"},"avatarUrl":{"type":"string"},"genderId":{"type":"string"},"preferedGenderId":{"type":"string"}}},"Gender":{"type":"object","properties":{"id":{"type":"number"},"name":{"type":"string"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}}},"Match":{"type":"object","properties":{"id":{"type":"string"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"matcherUserId":{"type":"string"},"matchedUserId":{"type":"string"}}},"MatchRequest":{"type":"object","properties":{"id":{"type":"string"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"matcherUserId":{"type":"string"},"matchedUserId":{"type":"string"}}},"Profile":{"type":"object","properties":{"id":{"type":"string"},"dateOfBirth":{"type":"string","format":"date-time"},"description":{"type":"string"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"preferedGender":{"type":"number"},"gender":{"type":"number"},"userId":{"type":"string"}}},"Track":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"albumName":{"type":"string"},"spotifyUri":{"type":"string"},"spotifyImage":{"type":"string"},"spotifyId":{"type":"string"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"userId":{"type":"string"}}},"User":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"email":{"type":"string"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"profileId":{"type":"string"}}}},"responses":{"NotFountException":{"description":"Not Fount Exception","content":{"application/json":{"schema":{"type":"object","properties":{"errors":{"type":"array","items":{"type":"object","properties":{"message":{"type":"string","example":"NOT_FOUND: NOT_FOUND"}}}}}}}}},"UnAuthorizedException":{"description":"Unauthorized access","content":{"application/json":{"schema":{"type":"object","properties":{"errors":{"type":"array","items":{"type":"object","properties":{"message":{"type":"string","example":"E_UNAUTHORIZED_ACCESS: Unauthorized access"}}}}}}}}}}},"paths":{"/api/matches/":{"get":{"summary":"fav an user","security":[{"bearerAuth":[]}],"tags":["Match"],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"properties":{"id":{"$ref":"#/components/schemas/User/properties/id"},"name":{"$ref":"#/components/schemas/User/properties/name"}}}},"message":{"type":"string","example":"Mutual match history"}}}}}},"401":{"$ref":"#/components/responses/UnAuthorizedException"}}}},"/api/spotify/top-five-tracks":{"get":{"summary":"get user spotify top five tracks","security":[{"bearerAuth":[]}],"tags":["Match"],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","items":{"$ref":"#/components/schemas/SerializedTrack"},"properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/SerializedTrack"}}}}}}},"401":{"$ref":"#/components/responses/UnAuthorizedException"}}}},"/api/users/{userId}/fav":{"get":{"summary":"fav an user","security":[{"bearerAuth":[]}],"tags":["User"],"parameters":[{"in":"path","name":"userId","required":true,"description":"User id","schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"It's a mutual match"}}}}}},"401":{"$ref":"#/components/responses/UnAuthorizedException"},"404":{"$ref":"#/components/responses/NotFountException"}}}},"/api/users":{"get":{"security":[{"bearerAuth":[]}],"tags":["User"],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/ProfileToShow"}}}}},"401":{"$ref":"#/components/responses/UnAuthorizedException"}}}},"/api/auth/logout":{"get":{"security":[{"bearerAuth":[]}],"tags":["Auth"],"responses":{"200":{"description":"Success"},"401":{"$ref":"#/components/responses/UnAuthorizedException"}}}},"/api/auth/profile":{"get":{"security":[{"bearerAuth":[]}],"tags":["Auth"],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SerializedUser"}}}},"401":{"$ref":"#/components/responses/UnAuthorizedException"}}},"post":{"security":[{"bearerAuth":[]}],"tags":["Auth"],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SerializedUser"}}}},"401":{"$ref":"#/components/responses/UnAuthorizedException"}}}},"/api/auth/profile/avatar":{"post":{"security":[{"bearerAuth":[]}],"tags":["Auth"],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SerializedUser"}}}},"401":{"$ref":"#/components/responses/UnAuthorizedException"}}}},"/api/auth/spotify":{"get":{"tags":["Spotify OAuth"],"responses":{"200":{"description":"Success"}}}}},"tags":[]} | ||
{ | ||
"openapi": "3.0.0", | ||
"info": { | ||
"title": "Application with swagger docs", | ||
"version": "1.0.0", | ||
"description": "My application with swagger docs" | ||
}, | ||
"components": { | ||
"securitySchemes": { | ||
"bearerAuth": { "type": "http", "scheme": "bearer", "bearerFormat": "JWT" } | ||
}, | ||
"schemas": { | ||
"SerializedTrack": { | ||
"type": "object", | ||
"properties": { | ||
"uri": { "type": "string" }, | ||
"popularity": { "type": "number" }, | ||
"name": { "type": "string" }, | ||
"trackId": { "type": "string" }, | ||
"album": { "type": "string" }, | ||
"image": { | ||
"type": "object", | ||
"properties": { | ||
"height": { "type": "number" }, | ||
"url": { "type": "string" }, | ||
"width": { "type": "number" } | ||
} | ||
}, | ||
"artistName": { "type": "string" } | ||
} | ||
}, | ||
"ProfileToShow": { | ||
"type": "object", | ||
"properties": { | ||
"user": { | ||
"type": "object", | ||
"properties": { | ||
"id": { "$ref": "#/components/schemas/User/properties/id" }, | ||
"name": { "$ref": "#/components/schemas/User/properties/name" }, | ||
"image": { "type": "string" } | ||
} | ||
}, | ||
"songs": { "type": "array", "items": { "$ref": "#/components/schemas/Track" } } | ||
} | ||
}, | ||
"SerializedUser": { | ||
"type": "object", | ||
"properties": { | ||
"id": { "type": "string" }, | ||
"name": { "type": "string" }, | ||
"email": { "type": "string" }, | ||
"dateOfBirth": { "type": "string", "format": "date-time" }, | ||
"description": { "type": "string" }, | ||
"avatarUrl": { "type": "string" }, | ||
"genderId": { "type": "string" }, | ||
"preferedGenderId": { "type": "string" } | ||
} | ||
}, | ||
"Gender": { | ||
"type": "object", | ||
"properties": { | ||
"id": { "type": "number" }, | ||
"name": { "type": "string" }, | ||
"createdAt": { "type": "string", "format": "date-time" }, | ||
"updatedAt": { "type": "string", "format": "date-time" } | ||
} | ||
}, | ||
"Match": { | ||
"type": "object", | ||
"properties": { | ||
"id": { "type": "string" }, | ||
"createdAt": { "type": "string", "format": "date-time" }, | ||
"updatedAt": { "type": "string", "format": "date-time" }, | ||
"matcherUserId": { "type": "string" }, | ||
"matchedUserId": { "type": "string" } | ||
} | ||
}, | ||
"MatchRequest": { | ||
"type": "object", | ||
"properties": { | ||
"id": { "type": "string" }, | ||
"createdAt": { "type": "string", "format": "date-time" }, | ||
"updatedAt": { "type": "string", "format": "date-time" }, | ||
"matcherUserId": { "type": "string" }, | ||
"matchedUserId": { "type": "string" } | ||
} | ||
}, | ||
"Profile": { | ||
"type": "object", | ||
"properties": { | ||
"id": { "type": "string" }, | ||
"dateOfBirth": { "type": "string", "format": "date-time" }, | ||
"description": { "type": "string" }, | ||
"createdAt": { "type": "string", "format": "date-time" }, | ||
"updatedAt": { "type": "string", "format": "date-time" }, | ||
"preferedGender": { "type": "number" }, | ||
"gender": { "type": "number" }, | ||
"userId": { "type": "string" } | ||
} | ||
}, | ||
"Track": { | ||
"type": "object", | ||
"properties": { | ||
"id": { "type": "string" }, | ||
"name": { "type": "string" }, | ||
"albumName": { "type": "string" }, | ||
"spotifyUri": { "type": "string" }, | ||
"spotifyImage": { "type": "string" }, | ||
"spotifyId": { "type": "string" }, | ||
"createdAt": { "type": "string", "format": "date-time" }, | ||
"updatedAt": { "type": "string", "format": "date-time" }, | ||
"userId": { "type": "string" } | ||
} | ||
}, | ||
"User": { | ||
"type": "object", | ||
"properties": { | ||
"id": { "type": "string" }, | ||
"name": { "type": "string" }, | ||
"email": { "type": "string" }, | ||
"createdAt": { "type": "string", "format": "date-time" }, | ||
"updatedAt": { "type": "string", "format": "date-time" }, | ||
"profileId": { "type": "string" } | ||
} | ||
} | ||
}, | ||
"responses": { | ||
"NotFountException": { | ||
"description": "Not Fount Exception", | ||
"content": { | ||
"application/json": { | ||
"schema": { | ||
"type": "object", | ||
"properties": { | ||
"errors": { | ||
"type": "array", | ||
"items": { | ||
"type": "object", | ||
"properties": { | ||
"message": { "type": "string", "example": "NOT_FOUND: NOT_FOUND" } | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
}, | ||
"UnAuthorizedException": { | ||
"description": "Unauthorized access", | ||
"content": { | ||
"application/json": { | ||
"schema": { | ||
"type": "object", | ||
"properties": { | ||
"errors": { | ||
"type": "array", | ||
"items": { | ||
"type": "object", | ||
"properties": { | ||
"message": { | ||
"type": "string", | ||
"example": "E_UNAUTHORIZED_ACCESS: Unauthorized access" | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
}, | ||
"paths": { | ||
"/api/matches/": { | ||
"get": { | ||
"summary": "fav an user", | ||
"security": [{ "bearerAuth": [] }], | ||
"tags": ["Match"], | ||
"responses": { | ||
"200": { | ||
"description": "Success", | ||
"content": { | ||
"application/json": { | ||
"schema": { | ||
"type": "object", | ||
"properties": { | ||
"data": { | ||
"type": "array", | ||
"items": { | ||
"properties": { | ||
"id": { "$ref": "#/components/schemas/User/properties/id" }, | ||
"name": { "$ref": "#/components/schemas/User/properties/name" } | ||
} | ||
} | ||
}, | ||
"message": { "type": "string", "example": "Mutual match history" } | ||
} | ||
} | ||
} | ||
} | ||
}, | ||
"401": { "$ref": "#/components/responses/UnAuthorizedException" } | ||
} | ||
} | ||
}, | ||
"/api/spotify/top-five-tracks": { | ||
"get": { | ||
"summary": "get user spotify top five tracks", | ||
"security": [{ "bearerAuth": [] }], | ||
"tags": ["Match"], | ||
"responses": { | ||
"200": { | ||
"description": "Success", | ||
"content": { | ||
"application/json": { | ||
"schema": { | ||
"type": "object", | ||
"items": { "$ref": "#/components/schemas/SerializedTrack" }, | ||
"properties": { | ||
"data": { | ||
"type": "array", | ||
"items": { "$ref": "#/components/schemas/SerializedTrack" } | ||
} | ||
} | ||
} | ||
} | ||
} | ||
}, | ||
"401": { "$ref": "#/components/responses/UnAuthorizedException" } | ||
} | ||
} | ||
}, | ||
"/api/users/{userId}/fav": { | ||
"get": { | ||
"summary": "fav an user", | ||
"security": [{ "bearerAuth": [] }], | ||
"tags": ["User"], | ||
"parameters": [ | ||
{ | ||
"in": "path", | ||
"name": "userId", | ||
"required": true, | ||
"description": "User id", | ||
"schema": { "type": "string" } | ||
} | ||
], | ||
"responses": { | ||
"200": { | ||
"description": "Success", | ||
"content": { | ||
"application/json": { | ||
"schema": { | ||
"type": "object", | ||
"properties": { | ||
"message": { "type": "string", "example": "It's a mutual match" } | ||
} | ||
} | ||
} | ||
} | ||
}, | ||
"401": { "$ref": "#/components/responses/UnAuthorizedException" }, | ||
"404": { "$ref": "#/components/responses/NotFountException" } | ||
} | ||
} | ||
}, | ||
"/api/users": { | ||
"get": { | ||
"security": [{ "bearerAuth": [] }], | ||
"tags": ["User"], | ||
"responses": { | ||
"200": { | ||
"description": "Success", | ||
"content": { | ||
"application/json": { | ||
"schema": { | ||
"type": "array", | ||
"items": { "$ref": "#/components/schemas/ProfileToShow" } | ||
} | ||
} | ||
} | ||
}, | ||
"401": { "$ref": "#/components/responses/UnAuthorizedException" } | ||
} | ||
} | ||
}, | ||
"/api/auth/logout": { | ||
"get": { | ||
"security": [{ "bearerAuth": [] }], | ||
"tags": ["Auth"], | ||
"responses": { | ||
"200": { "description": "Success" }, | ||
"401": { "$ref": "#/components/responses/UnAuthorizedException" } | ||
} | ||
} | ||
}, | ||
"/api/auth/profile": { | ||
"get": { | ||
"security": [{ "bearerAuth": [] }], | ||
"tags": ["Auth"], | ||
"responses": { | ||
"200": { | ||
"description": "Success", | ||
"content": { | ||
"application/json": { "schema": { "$ref": "#/components/schemas/SerializedUser" } } | ||
} | ||
}, | ||
"401": { "$ref": "#/components/responses/UnAuthorizedException" } | ||
} | ||
}, | ||
"post": { | ||
"security": [{ "bearerAuth": [] }], | ||
"tags": ["Auth"], | ||
"responses": { | ||
"200": { | ||
"description": "Success", | ||
"content": { | ||
"application/json": { "schema": { "$ref": "#/components/schemas/SerializedUser" } } | ||
} | ||
}, | ||
"401": { "$ref": "#/components/responses/UnAuthorizedException" } | ||
} | ||
} | ||
}, | ||
"/api/auth/profile/avatar": { | ||
"post": { | ||
"security": [{ "bearerAuth": [] }], | ||
"tags": ["Auth"], | ||
"responses": { | ||
"200": { | ||
"description": "Success", | ||
"content": { | ||
"application/json": { "schema": { "$ref": "#/components/schemas/SerializedUser" } } | ||
} | ||
}, | ||
"401": { "$ref": "#/components/responses/UnAuthorizedException" } | ||
} | ||
} | ||
}, | ||
"/api/auth/spotify": { | ||
"get": { "tags": ["Spotify OAuth"], "responses": { "200": { "description": "Success" } } } | ||
} | ||
}, | ||
"tags": [] | ||
} |