Update Swagger defs to OAPI3.0

This commit is contained in:
Qstick 2020-07-25 00:59:00 -04:00
parent b077d1c6cf
commit 86a75e2641
2 changed files with 476 additions and 474 deletions

View File

@ -35,14 +35,15 @@
"summary": "Get all movies", "summary": "Get all movies",
"description": "Returns all movies", "description": "Returns all movies",
"operationId": "getMovie", "operationId": "getMovie",
"produces": [
"application/json"
],
"responses": { "responses": {
"200": { "200": {
"description": "successful operation", "description": "successful operation",
"schema": { "content": {
"$ref": "#/definitions/Movie" "application/json": {
"schema": {
"$ref": "#/components/schemas/Movie"
}
}
} }
}, },
"400": { "400": {
@ -63,28 +64,26 @@
"Movie" "Movie"
], ],
"summary": "Add new movie", "summary": "Add new movie",
"consumes": [ "requestBody": {
"application/json" "description": "Movie object that needs to be added",
], "required": true,
"produces": [ "content": {
"application/json" "application/json": {
], "schema": {
"parameters": [ "$ref": "#/components/schemas/Movie"
{ }
"in": "body",
"name": "body",
"description": "Movie object that needs to be added",
"required": true,
"schema": {
"$ref": "#/definitions/Movie"
} }
} }
], },
"responses": { "responses": {
"200": { "200": {
"description": "successful operation", "description": "successful operation",
"schema": { "content": {
"type": "integer" "application/json": {
"schema": {
"type": "integer"
}
}
} }
}, },
"405": { "405": {
@ -102,28 +101,26 @@
"Movie" "Movie"
], ],
"summary": "Edit existing movie", "summary": "Edit existing movie",
"consumes": [ "requestBody": {
"application/json" "description": "Movie object that needs to be edited",
], "required": true,
"produces": [ "content": {
"application/json" "application/json": {
], "schema": {
"parameters": [ "$ref": "#/components/schemas/Movie"
{ }
"in": "body",
"name": "body",
"description": "Movie object that needs to be edited",
"required": true,
"schema": {
"$ref": "#/definitions/Movie"
} }
} }
], },
"responses": { "responses": {
"200": { "200": {
"description": "successful operation", "description": "successful operation",
"schema": { "content": {
"$ref": "#/definitions/Movie" "application/json": {
"schema": {
"$ref": "#/components/schemas/Movie"
}
}
} }
}, },
"404": { "404": {
@ -148,24 +145,26 @@
"summary": "Get movie by ID", "summary": "Get movie by ID",
"description": "Returns a single movie", "description": "Returns a single movie",
"operationId": "getMovieById", "operationId": "getMovieById",
"produces": [
"application/json"
],
"parameters": [ "parameters": [
{ {
"name": "movieId", "name": "movieId",
"in": "path", "in": "path",
"description": "ID of movie to return", "description": "ID of movie to return",
"required": true, "required": true,
"type": "integer", "schema": {
"format": "int64" "type": "integer"
}
} }
], ],
"responses": { "responses": {
"200": { "200": {
"description": "successful operation", "description": "successful operation",
"schema": { "content": {
"$ref": "#/definitions/Movie" "application/json": {
"schema": {
"$ref": "#/components/schemas/Movie"
}
}
} }
}, },
"400": { "400": {
@ -188,27 +187,29 @@
"summary": "Deletes a Movie", "summary": "Deletes a Movie",
"description": "", "description": "",
"operationId": "deleteMovie", "operationId": "deleteMovie",
"produces": [
"application/json"
],
"parameters": [ "parameters": [
{ {
"name": "movieId", "name": "movieId",
"in": "path", "in": "path",
"description": "Movie id to delete", "description": "Movie id to delete",
"required": true, "required": true,
"type": "integer", "schema": {
"format": "int64" "type": "integer"
}
}, },
{ {
"name": "addNetImportExclusion", "name": "addNetImportExclusion",
"in": "query", "in": "query",
"type": "boolean" "schema": {
"type": "boolean"
}
}, },
{ {
"name": "deleteFiles", "name": "deleteFiles",
"in": "query", "in": "query",
"type": "boolean" "schema": {
"type": "boolean"
}
} }
], ],
"responses": { "responses": {
@ -228,6 +229,190 @@
} }
}, },
"components": { "components": {
"schemas": {
"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": "#/components/schemas/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": "#/components/schemas/Rating"
},
"collection": {
"$ref": "#/components/schemas/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": "#/components/schemas/Image"
}
}
},
"xml": {
"name": "Collection"
}
},
"Rating": {
"type": "object",
"properties": {
"votes": {
"type": "integer"
},
"value": {
"type": "integer"
}
},
"xml": {
"name": "Rating"
}
}
},
"securitySchemes": { "securitySchemes": {
"api_key": { "api_key": {
"type": "apiKey", "type": "apiKey",
@ -239,189 +424,5 @@
"externalDocs": { "externalDocs": {
"description": "GitHub", "description": "GitHub",
"url": "https://github.com/Radarr/Radarr" "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"
}
}
} }
} }

View File

@ -35,14 +35,15 @@
"summary": "Get all movies", "summary": "Get all movies",
"description": "Returns all movies", "description": "Returns all movies",
"operationId": "getMovie", "operationId": "getMovie",
"produces": [
"application/json"
],
"responses": { "responses": {
"200": { "200": {
"description": "successful operation", "description": "successful operation",
"schema": { "content": {
"$ref": "#/definitions/Movie" "application/json": {
"schema": {
"$ref": "#/components/schemas/Movie"
}
}
} }
}, },
"400": { "400": {
@ -63,28 +64,26 @@
"Movie" "Movie"
], ],
"summary": "Add new movie", "summary": "Add new movie",
"consumes": [ "requestBody": {
"application/json" "description": "Movie object that needs to be added",
], "required": true,
"produces": [ "content": {
"application/json" "application/json": {
], "schema": {
"parameters": [ "$ref": "#/components/schemas/Movie"
{ }
"in": "body",
"name": "body",
"description": "Movie object that needs to be added",
"required": true,
"schema": {
"$ref": "#/definitions/Movie"
} }
} }
], },
"responses": { "responses": {
"200": { "200": {
"description": "successful operation", "description": "successful operation",
"schema": { "content": {
"type": "integer" "application/json": {
"schema": {
"type": "integer"
}
}
} }
}, },
"405": { "405": {
@ -102,28 +101,26 @@
"Movie" "Movie"
], ],
"summary": "Edit existing movie", "summary": "Edit existing movie",
"consumes": [ "requestBody": {
"application/json" "description": "Movie object that needs to be edited",
], "required": true,
"produces": [ "content": {
"application/json" "application/json": {
], "schema": {
"parameters": [ "$ref": "#/components/schemas/Movie"
{ }
"in": "body",
"name": "body",
"description": "Movie object that needs to be edited",
"required": true,
"schema": {
"$ref": "#/definitions/Movie"
} }
} }
], },
"responses": { "responses": {
"200": { "200": {
"description": "successful operation", "description": "successful operation",
"schema": { "content": {
"$ref": "#/definitions/Movie" "application/json": {
"schema": {
"$ref": "#/components/schemas/Movie"
}
}
} }
}, },
"404": { "404": {
@ -148,24 +145,26 @@
"summary": "Get movie by ID", "summary": "Get movie by ID",
"description": "Returns a single movie", "description": "Returns a single movie",
"operationId": "getMovieById", "operationId": "getMovieById",
"produces": [
"application/json"
],
"parameters": [ "parameters": [
{ {
"name": "movieId", "name": "movieId",
"in": "path", "in": "path",
"description": "ID of movie to return", "description": "ID of movie to return",
"required": true, "required": true,
"type": "integer", "schema": {
"format": "int64" "type": "integer"
}
} }
], ],
"responses": { "responses": {
"200": { "200": {
"description": "successful operation", "description": "successful operation",
"schema": { "content": {
"$ref": "#/definitions/Movie" "application/json": {
"schema": {
"$ref": "#/components/schemas/Movie"
}
}
} }
}, },
"400": { "400": {
@ -188,27 +187,29 @@
"summary": "Deletes a Movie", "summary": "Deletes a Movie",
"description": "", "description": "",
"operationId": "deleteMovie", "operationId": "deleteMovie",
"produces": [
"application/json"
],
"parameters": [ "parameters": [
{ {
"name": "movieId", "name": "movieId",
"in": "path", "in": "path",
"description": "Movie id to delete", "description": "Movie id to delete",
"required": true, "required": true,
"type": "integer", "schema": {
"format": "int64" "type": "integer"
}
}, },
{ {
"name": "addNetImportExclusion", "name": "addNetImportExclusion",
"in": "query", "in": "query",
"type": "boolean" "schema": {
"type": "boolean"
}
}, },
{ {
"name": "deleteFiles", "name": "deleteFiles",
"in": "query", "in": "query",
"type": "boolean" "schema": {
"type": "boolean"
}
} }
], ],
"responses": { "responses": {
@ -228,6 +229,190 @@
} }
}, },
"components": { "components": {
"schemas": {
"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": "#/components/schemas/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": "#/components/schemas/Rating"
},
"collection": {
"$ref": "#/components/schemas/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": "#/components/schemas/Image"
}
}
},
"xml": {
"name": "Collection"
}
},
"Rating": {
"type": "object",
"properties": {
"votes": {
"type": "integer"
},
"value": {
"type": "integer"
}
},
"xml": {
"name": "Rating"
}
}
},
"securitySchemes": { "securitySchemes": {
"api_key": { "api_key": {
"type": "apiKey", "type": "apiKey",
@ -239,189 +424,5 @@
"externalDocs": { "externalDocs": {
"description": "GitHub", "description": "GitHub",
"url": "https://github.com/Radarr/Radarr" "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"
}
}
} }
} }