This repository has been archived on 2024-12-07. You can view files and clone it, but cannot push or open issues or pull requests.
Cinemateket/backend/openapi.yaml
Sindre Kjelsrud 82f2c29748 📝 openapi swagger file finito
Co-authored-by: haraldnilsen <harald_998@hotmail.com>
2023-09-26 10:51:58 +02:00

176 lines
4.3 KiB
YAML

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: string
- 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: true
type: string
- name: imdbID
in: query
description: ImdbID of movie
required: true
type: string
- name: type
in: query
description: Movie or series
required: true
type: string
enum:
- movie
- series
- name: poster
in: query
description: Poster of movie
required: true
type: string
responses:
'200':
description: Successful operation
'400':
description: Bad request
'409':
description: Conflict
'500':
description: Internal server error
put:
tags:
- Search Parameter
summary: Make changes to an existing movie
operationId: titleSearch
parameters:
- name: imdbID
in: query
description: ImdbID of movie
required: true
type: string
- name: s
in: query
description: Title of movie or series
required: false
type: string
- name: y
in: query
description: Year of release
required: false
type: integer
- name: type
in: query
description: Movie or series
required: false
type: string
enum:
- movie
- series
- name: poster
in: query
description: Poster of movie
required: false
type: string
responses:
'200':
description: Successful operation
'400':
description: Bad request
'409':
description: Conflict
'500':
description: Internal server error
delete:
tags:
- Search Parameter
summary: Deletes a movie with a given title or imdbID
operationId: titleSearch
parameters:
- name: imdbID
in: query
description: ImdbID of movie
required: true
type: string
responses:
'200':
description: Successful operation
'400':
description: Bad request
'409':
description: Conflict
'500':
description: Internal server error