diff --git a/backend/openapi.yaml b/backend/openapi.yaml new file mode 100644 index 0000000..81bb8aa --- /dev/null +++ b/backend/openapi.yaml @@ -0,0 +1,196 @@ +swagger: '2.0' +info: + description: 'This API is made for our task for WA.works.' + version: '1.0' + title: Cinemateket API + license: + name: Github-repository + url: https://github.com/SindreKjelsrud/Cinemateket/ +host: github.com +basePath: '/SindreKjelsrud/Cinemateket/' +tags: + - name: Search Parameter + description: e.g. ?s=title +schemes: + - http + - https +paths: + '/?s': + get: + tags: + - Search Parameter + summary: Returns an array of results for a given title + operationId: titleSearch + parameters: + - name: s + in: query + description: Title of movie or series + required: true + type: string + - name: y + in: query + description: Year of release + required: false + type: integer + - name: type + in: query + description: Return movie or series + required: false + type: string + enum: + - movie + - series + - name: sort + in: query + description: Choose sorted order to return + required: false + type: string + enum: + - titleasc + - titledesc + - yearasc + - yeardesc + - name: pageNumber + in: query + description: Page number to return + required: false + type: integer + - name: pageSize + in: query + description: Size of pages to return + type: integer + responses: + '200': + description: Successful operation + '204': + description: No content + '400': + description: Bad request + '500': + description: Internal server error + post: + tags: + - Search Parameter + summary: Inserts a new movie to the database + operationId: titleSearch + parameters: + - name: s + in: query + description: Title of movie or series + required: true + type: string + - name: y + in: query + description: Year of release + required: false + type: integer + - name: type + in: query + description: Return movie or series + required: false + type: string + enum: + - movie + - series + - name: pageNumber + in: query + description: Page number to return + required: false + type: integer + - name: pageSize + in: query + description: Size of pages to return + type: integer + responses: + '200': + description: Successful operation + '204': + description: No content + '400': + description: Bad request + '500': + description: Internal server error + put: + tags: + - Search Parameter + summary: Make changes to an existing movie + operationId: titleSearch + parameters: + - name: s + in: query + description: Title of movie or series + required: true + type: string + - name: y + in: query + description: Year of release + required: false + type: integer + - name: type + in: query + description: Return movie or series + required: false + type: string + enum: + - movie + - series + - name: pageNumber + in: query + description: Page number to return + required: false + type: integer + - name: pageSize + in: query + description: Size of pages to return + type: integer + responses: + '200': + description: Successful operation + '204': + description: No content + '400': + description: Bad request + '500': + description: Internal server error + delete: + tags: + - Search Parameter + summary: Deletes a movie with a given title or imdbID + operationId: titleSearch + parameters: + - name: s + in: query + description: Title of movie or series + required: true + type: string + - name: y + in: query + description: Year of release + required: false + type: integer + - name: type + in: query + description: Return movie or series + required: false + type: string + enum: + - movie + - series + - name: pageNumber + in: query + description: Page number to return + required: false + type: integer + - name: pageSize + in: query + description: Size of pages to return + type: integer + responses: + '200': + description: Successful operation + '204': + description: No content + '400': + description: Bad request + '500': + description: Internal server error