From b077d1c6cfe9549f074c58f4217debaf739eac50 Mon Sep 17 00:00:00 2001 From: Qstick Date: Sat, 25 Jul 2020 00:39:10 -0400 Subject: [PATCH] Push Swagger definitions to main repo [skip ci] --- src/NzbDrone.Api/swagger.json | 427 +++++++++++++++++++++++++++++++++ src/Radarr.Api.V3/swagger.json | 427 +++++++++++++++++++++++++++++++++ 2 files changed, 854 insertions(+) create mode 100644 src/NzbDrone.Api/swagger.json create mode 100644 src/Radarr.Api.V3/swagger.json diff --git a/src/NzbDrone.Api/swagger.json b/src/NzbDrone.Api/swagger.json new file mode 100644 index 000000000..1da697634 --- /dev/null +++ b/src/NzbDrone.Api/swagger.json @@ -0,0 +1,427 @@ +{ + "openapi": "3.0.0", + "info": { + "title": "Radarr", + "description": "Movie Automation", + "contact": { + "url": "https://radarr.video" + }, + "version": "0.2.0" + }, + "servers": [ + { + "url": "{protocol}://{hostPath}/api", + "variables": { + "protocol": { + "enum": [ + "https", + "http" + ], + "default": "https" + }, + "hostPath": { + "default": "localhost:7878", + "description": "Your Radarr Server URL" + } + } + } + ], + "paths": { + "/movie": { + "get": { + "tags": [ + "Movie" + ], + "summary": "Get all movies", + "description": "Returns all movies", + "operationId": "getMovie", + "produces": [ + "application/json" + ], + "responses": { + "200": { + "description": "successful operation", + "schema": { + "$ref": "#/definitions/Movie" + } + }, + "400": { + "description": "Invalid ID supplied" + }, + "404": { + "description": "Movie not found" + } + }, + "security": [ + { + "api_key": [] + } + ] + }, + "post": { + "tags": [ + "Movie" + ], + "summary": "Add new movie", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "parameters": [ + { + "in": "body", + "name": "body", + "description": "Movie object that needs to be added", + "required": true, + "schema": { + "$ref": "#/definitions/Movie" + } + } + ], + "responses": { + "200": { + "description": "successful operation", + "schema": { + "type": "integer" + } + }, + "405": { + "description": "Validation exception" + } + }, + "security": [ + { + "api_key": [] + } + ] + }, + "put": { + "tags": [ + "Movie" + ], + "summary": "Edit existing movie", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "parameters": [ + { + "in": "body", + "name": "body", + "description": "Movie object that needs to be edited", + "required": true, + "schema": { + "$ref": "#/definitions/Movie" + } + } + ], + "responses": { + "200": { + "description": "successful operation", + "schema": { + "$ref": "#/definitions/Movie" + } + }, + "404": { + "description": "Movie not found" + }, + "405": { + "description": "Validation exception" + } + }, + "security": [ + { + "api_key": [] + } + ] + } + }, + "/movie/{movieId}": { + "get": { + "tags": [ + "Movie" + ], + "summary": "Get movie by ID", + "description": "Returns a single movie", + "operationId": "getMovieById", + "produces": [ + "application/json" + ], + "parameters": [ + { + "name": "movieId", + "in": "path", + "description": "ID of movie to return", + "required": true, + "type": "integer", + "format": "int64" + } + ], + "responses": { + "200": { + "description": "successful operation", + "schema": { + "$ref": "#/definitions/Movie" + } + }, + "400": { + "description": "Invalid ID supplied" + }, + "404": { + "description": "Movie not found" + } + }, + "security": [ + { + "api_key": [] + } + ] + }, + "delete": { + "tags": [ + "Movie" + ], + "summary": "Deletes a Movie", + "description": "", + "operationId": "deleteMovie", + "produces": [ + "application/json" + ], + "parameters": [ + { + "name": "movieId", + "in": "path", + "description": "Movie id to delete", + "required": true, + "type": "integer", + "format": "int64" + }, + { + "name": "addNetImportExclusion", + "in": "query", + "type": "boolean" + }, + { + "name": "deleteFiles", + "in": "query", + "type": "boolean" + } + ], + "responses": { + "400": { + "description": "Invalid ID supplied" + }, + "404": { + "description": "Movie not found" + } + }, + "security": [ + { + "api_key": [] + } + ] + } + } + }, + "components": { + "securitySchemes": { + "api_key": { + "type": "apiKey", + "in": "query", + "name": "apiKey" + } + } + }, + "externalDocs": { + "description": "GitHub", + "url": "https://github.com/Radarr/Radarr" + }, + "definitions": { + "Movie": { + "type": "object", + "required": [ + "title" + ], + "properties": { + "id": { + "type": "integer", + "format": "int64" + }, + "title": { + "type": "string", + "example": "Dark Phoenix" + }, + "sortTitle": { + "type": "string", + "example": "dark phoenix" + }, + "sizeOnDisk": { + "type": "number" + }, + "overview": { + "type": "string" + }, + "inCinemas": { + "type": "string" + }, + "physicalRelease": { + "type": "string" + }, + "images": { + "type": "array", + "items": { + "$ref": "#/definitions/Image" + } + }, + "website": { + "type": "string", + "example": "http://darkphoenix.com" + }, + "year": { + "type": "integer" + }, + "hasFile": { + "type": "boolean" + }, + "youTubeTrailerId": { + "type": "string" + }, + "studio": { + "type": "string" + }, + "path": { + "type": "string" + }, + "qualityProfileId": { + "type": "integer" + }, + "monitored": { + "type": "boolean" + }, + "minimumAcailability": { + "type": "string", + "enum": [ + "announced", + "inCinema", + "released" + ] + }, + "isAvailable": { + "type": "boolean" + }, + "folderName": { + "type": "string" + }, + "runtime": { + "type": "integer" + }, + "cleanTitle": { + "type": "string" + }, + "imdbId": { + "type": "string" + }, + "tmdbId": { + "type": "integer" + }, + "titleSlug": { + "type": "integer" + }, + "certification": { + "type": "string" + }, + "genres": { + "type": "array", + "items": { + "type": "string" + } + }, + "tags": { + "type": "array", + "items": { + "type": "integer" + } + }, + "added": { + "type": "string" + }, + "ratings": { + "$ref": "#/definitions/Rating" + }, + "collection": { + "$ref": "#/definitions/Collection" + }, + "status": { + "type": "string", + "description": "movie status", + "enum": [ + "deleted", + "tba", + "announced", + "inCinema", + "released" + ] + } + }, + "xml": { + "name": "Movie" + } + }, + "Image": { + "type": "object", + "properties": { + "coverType": { + "type": "string", + "enum": [ + "poster", + "fanart" + ] + }, + "url": { + "type": "string" + } + }, + "xml": { + "name": "Image" + } + }, + "Collection": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "tmdbId": { + "type": "integer" + }, + "images": { + "type": "array", + "items": { + "$ref": "#/definitions/Image" + } + } + }, + "xml": { + "name": "Collection" + } + }, + "Rating": { + "type": "object", + "properties": { + "votes": { + "type": "integer" + }, + "value": { + "type": "integer" + } + }, + "xml": { + "name": "Rating" + } + } + } +} \ No newline at end of file diff --git a/src/Radarr.Api.V3/swagger.json b/src/Radarr.Api.V3/swagger.json new file mode 100644 index 000000000..54f9da279 --- /dev/null +++ b/src/Radarr.Api.V3/swagger.json @@ -0,0 +1,427 @@ +{ + "openapi": "3.0.0", + "info": { + "title": "Radarr", + "description": "Movie Automation", + "contact": { + "url": "https://radarr.video" + }, + "version": "3.0.0" + }, + "servers": [ + { + "url": "{protocol}://{hostPath}/api/v3", + "variables": { + "protocol": { + "enum": [ + "https", + "http" + ], + "default": "https" + }, + "hostPath": { + "default": "localhost:7878", + "description": "Your Radarr Server URL" + } + } + } + ], + "paths": { + "/movie": { + "get": { + "tags": [ + "Movie" + ], + "summary": "Get all movies", + "description": "Returns all movies", + "operationId": "getMovie", + "produces": [ + "application/json" + ], + "responses": { + "200": { + "description": "successful operation", + "schema": { + "$ref": "#/definitions/Movie" + } + }, + "400": { + "description": "Invalid ID supplied" + }, + "404": { + "description": "Movie not found" + } + }, + "security": [ + { + "api_key": [] + } + ] + }, + "post": { + "tags": [ + "Movie" + ], + "summary": "Add new movie", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "parameters": [ + { + "in": "body", + "name": "body", + "description": "Movie object that needs to be added", + "required": true, + "schema": { + "$ref": "#/definitions/Movie" + } + } + ], + "responses": { + "200": { + "description": "successful operation", + "schema": { + "type": "integer" + } + }, + "405": { + "description": "Validation exception" + } + }, + "security": [ + { + "api_key": [] + } + ] + }, + "put": { + "tags": [ + "Movie" + ], + "summary": "Edit existing movie", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "parameters": [ + { + "in": "body", + "name": "body", + "description": "Movie object that needs to be edited", + "required": true, + "schema": { + "$ref": "#/definitions/Movie" + } + } + ], + "responses": { + "200": { + "description": "successful operation", + "schema": { + "$ref": "#/definitions/Movie" + } + }, + "404": { + "description": "Movie not found" + }, + "405": { + "description": "Validation exception" + } + }, + "security": [ + { + "api_key": [] + } + ] + } + }, + "/movie/{movieId}": { + "get": { + "tags": [ + "Movie" + ], + "summary": "Get movie by ID", + "description": "Returns a single movie", + "operationId": "getMovieById", + "produces": [ + "application/json" + ], + "parameters": [ + { + "name": "movieId", + "in": "path", + "description": "ID of movie to return", + "required": true, + "type": "integer", + "format": "int64" + } + ], + "responses": { + "200": { + "description": "successful operation", + "schema": { + "$ref": "#/definitions/Movie" + } + }, + "400": { + "description": "Invalid ID supplied" + }, + "404": { + "description": "Movie not found" + } + }, + "security": [ + { + "api_key": [] + } + ] + }, + "delete": { + "tags": [ + "Movie" + ], + "summary": "Deletes a Movie", + "description": "", + "operationId": "deleteMovie", + "produces": [ + "application/json" + ], + "parameters": [ + { + "name": "movieId", + "in": "path", + "description": "Movie id to delete", + "required": true, + "type": "integer", + "format": "int64" + }, + { + "name": "addNetImportExclusion", + "in": "query", + "type": "boolean" + }, + { + "name": "deleteFiles", + "in": "query", + "type": "boolean" + } + ], + "responses": { + "400": { + "description": "Invalid ID supplied" + }, + "404": { + "description": "Movie not found" + } + }, + "security": [ + { + "api_key": [] + } + ] + } + } + }, + "components": { + "securitySchemes": { + "api_key": { + "type": "apiKey", + "in": "query", + "name": "apiKey" + } + } + }, + "externalDocs": { + "description": "GitHub", + "url": "https://github.com/Radarr/Radarr" + }, + "definitions": { + "Movie": { + "type": "object", + "required": [ + "title" + ], + "properties": { + "id": { + "type": "integer", + "format": "int64" + }, + "title": { + "type": "string", + "example": "Dark Phoenix" + }, + "sortTitle": { + "type": "string", + "example": "dark phoenix" + }, + "sizeOnDisk": { + "type": "number" + }, + "overview": { + "type": "string" + }, + "inCinemas": { + "type": "string" + }, + "physicalRelease": { + "type": "string" + }, + "images": { + "type": "array", + "items": { + "$ref": "#/definitions/Image" + } + }, + "website": { + "type": "string", + "example": "http://darkphoenix.com" + }, + "year": { + "type": "integer" + }, + "hasFile": { + "type": "boolean" + }, + "youTubeTrailerId": { + "type": "string" + }, + "studio": { + "type": "string" + }, + "path": { + "type": "string" + }, + "qualityProfileId": { + "type": "integer" + }, + "monitored": { + "type": "boolean" + }, + "minimumAcailability": { + "type": "string", + "enum": [ + "announced", + "inCinema", + "released" + ] + }, + "isAvailable": { + "type": "boolean" + }, + "folderName": { + "type": "string" + }, + "runtime": { + "type": "integer" + }, + "cleanTitle": { + "type": "string" + }, + "imdbId": { + "type": "string" + }, + "tmdbId": { + "type": "integer" + }, + "titleSlug": { + "type": "integer" + }, + "certification": { + "type": "string" + }, + "genres": { + "type": "array", + "items": { + "type": "string" + } + }, + "tags": { + "type": "array", + "items": { + "type": "integer" + } + }, + "added": { + "type": "string" + }, + "ratings": { + "$ref": "#/definitions/Rating" + }, + "collection": { + "$ref": "#/definitions/Collection" + }, + "status": { + "type": "string", + "description": "movie status", + "enum": [ + "deleted", + "tba", + "announced", + "inCinema", + "released" + ] + } + }, + "xml": { + "name": "Movie" + } + }, + "Image": { + "type": "object", + "properties": { + "coverType": { + "type": "string", + "enum": [ + "poster", + "fanart" + ] + }, + "url": { + "type": "string" + } + }, + "xml": { + "name": "Image" + } + }, + "Collection": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "tmdbId": { + "type": "integer" + }, + "images": { + "type": "array", + "items": { + "$ref": "#/definitions/Image" + } + } + }, + "xml": { + "name": "Collection" + } + }, + "Rating": { + "type": "object", + "properties": { + "votes": { + "type": "integer" + }, + "value": { + "type": "integer" + } + }, + "xml": { + "name": "Rating" + } + } + } +} \ No newline at end of file