{ "swagger": "2.0", "info": { "title": "Tests Online", "description": "", "version": "v1" }, "host": "localhost:8000", "schemes": [ "http" ], "basePath": "/api/v1", "consumes": [ "application/json" ], "produces": [ "application/json" ], "securityDefinitions": { "basic": { "type": "basic" }, "api_key": { "type": "apiKey", "description": "Bearer ", "name": "Authorization", "in": "header" } }, "security": [ { "api_key": [] }, { "basic": [] } ], "paths": { "/auth/token/obtain/": { "post": { "operationId": "auth_token_obtain_create", "description": "Takes a set of user credentials and returns an access and refresh JSON web\ntoken pair to prove the authentication of those credentials.", "parameters": [ { "name": "data", "in": "body", "required": true, "schema": { "$ref": "#/definitions/TokenObtainPair" } } ], "responses": { "201": { "description": "", "schema": { "$ref": "#/definitions/TokenObtainPair" } } }, "tags": [ "auth" ] }, "parameters": [] }, "/auth/token/refresh/": { "post": { "operationId": "auth_token_refresh_create", "description": "Takes a refresh type JSON web token and returns an access type JSON web\ntoken if the refresh token is valid.", "parameters": [ { "name": "data", "in": "body", "required": true, "schema": { "$ref": "#/definitions/TokenRefresh" } } ], "responses": { "201": { "description": "", "schema": { "$ref": "#/definitions/TokenRefresh" } } }, "tags": [ "auth" ] }, "parameters": [] }, "/auth/token/verify/": { "post": { "operationId": "auth_token_verify_create", "description": "Takes a token and indicates if it is valid. This view provides no\ninformation about a token's fitness for a particular use.", "parameters": [ { "name": "data", "in": "body", "required": true, "schema": { "$ref": "#/definitions/TokenVerify" } } ], "responses": { "201": { "description": "", "schema": { "$ref": "#/definitions/TokenVerify" } } }, "tags": [ "auth" ] }, "parameters": [] }, "/debug/500/": { "get": { "operationId": "debug_500_list", "description": "", "parameters": [], "responses": { "200": { "description": "" } }, "tags": [ "debug" ] }, "parameters": [] }, "/debug/echo/": { "get": { "operationId": "debug_echo_list", "description": "", "parameters": [], "responses": { "200": { "description": "" } }, "tags": [ "debug" ] }, "parameters": [] }, "/debug/info/": { "get": { "operationId": "debug_info_list", "description": "", "parameters": [], "responses": { "200": { "description": "" } }, "tags": [ "debug" ] }, "parameters": [] }, "/tests/": { "get": { "operationId": "tests_list", "description": "", "parameters": [ { "name": "page", "in": "query", "description": "A page number within the paginated result set.", "required": false, "type": "integer" } ], "responses": { "200": { "description": "", "schema": { "required": [ "count", "results" ], "type": "object", "properties": { "count": { "type": "integer" }, "next": { "type": "string", "format": "uri", "x-nullable": true }, "previous": { "type": "string", "format": "uri", "x-nullable": true }, "results": { "type": "array", "items": { "$ref": "#/definitions/TestReadOnlyShort" } } } } } }, "tags": [ "tests" ] }, "post": { "operationId": "tests_create", "description": "", "parameters": [ { "name": "data", "in": "body", "required": true, "schema": { "$ref": "#/definitions/Test" } } ], "responses": { "201": { "description": "", "schema": { "$ref": "#/definitions/Test" } } }, "tags": [ "tests" ] }, "parameters": [] }, "/tests/{hash}/": { "get": { "operationId": "tests_read", "description": "", "parameters": [], "responses": { "200": { "description": "", "schema": { "$ref": "#/definitions/TestReadOnly" } } }, "tags": [ "tests" ] }, "put": { "operationId": "tests_update", "description": "", "parameters": [ { "name": "data", "in": "body", "required": true, "schema": { "$ref": "#/definitions/Test" } } ], "responses": { "200": { "description": "", "schema": { "$ref": "#/definitions/Test" } } }, "tags": [ "tests" ] }, "patch": { "operationId": "tests_partial_update", "description": "", "parameters": [ { "name": "data", "in": "body", "required": true, "schema": { "$ref": "#/definitions/Test" } } ], "responses": { "200": { "description": "", "schema": { "$ref": "#/definitions/Test" } } }, "tags": [ "tests" ] }, "delete": { "operationId": "tests_delete", "description": "", "parameters": [], "responses": { "204": { "description": "" } }, "tags": [ "tests" ] }, "parameters": [ { "name": "hash", "in": "path", "required": true, "type": "string" } ] }, "/tests/{test_hash}/questions/": { "get": { "operationId": "tests_questions_list", "description": "", "parameters": [ { "name": "page", "in": "query", "description": "A page number within the paginated result set.", "required": false, "type": "integer" } ], "responses": { "200": { "description": "", "schema": { "required": [ "count", "results" ], "type": "object", "properties": { "count": { "type": "integer" }, "next": { "type": "string", "format": "uri", "x-nullable": true }, "previous": { "type": "string", "format": "uri", "x-nullable": true }, "results": { "type": "array", "items": { "$ref": "#/definitions/QuestionReadOnly" } } } } } }, "tags": [ "tests" ] }, "post": { "operationId": "tests_questions_create", "description": "", "parameters": [ { "name": "data", "in": "body", "required": true, "schema": { "$ref": "#/definitions/Question" } } ], "responses": { "201": { "description": "", "schema": { "$ref": "#/definitions/Question" } } }, "tags": [ "tests" ] }, "parameters": [ { "name": "test_hash", "in": "path", "required": true, "type": "string" } ] }, "/tests/{test_hash}/questions/{id}/": { "get": { "operationId": "tests_questions_read", "description": "", "parameters": [], "responses": { "200": { "description": "", "schema": { "$ref": "#/definitions/QuestionReadOnly" } } }, "tags": [ "tests" ] }, "put": { "operationId": "tests_questions_update", "description": "", "parameters": [ { "name": "data", "in": "body", "required": true, "schema": { "$ref": "#/definitions/Question" } } ], "responses": { "200": { "description": "", "schema": { "$ref": "#/definitions/Question" } } }, "tags": [ "tests" ] }, "patch": { "operationId": "tests_questions_partial_update", "description": "", "parameters": [ { "name": "data", "in": "body", "required": true, "schema": { "$ref": "#/definitions/Question" } } ], "responses": { "200": { "description": "", "schema": { "$ref": "#/definitions/Question" } } }, "tags": [ "tests" ] }, "delete": { "operationId": "tests_questions_delete", "description": "", "parameters": [], "responses": { "204": { "description": "" } }, "tags": [ "tests" ] }, "parameters": [ { "name": "id", "in": "path", "description": "A unique integer value identifying this Question.", "required": true, "type": "integer" }, { "name": "test_hash", "in": "path", "required": true, "type": "string" } ] }, "/tests/{test_hash}/questions/{question_pk}/answers/": { "get": { "operationId": "tests_questions_answers_list", "description": "", "parameters": [ { "name": "page", "in": "query", "description": "A page number within the paginated result set.", "required": false, "type": "integer" } ], "responses": { "200": { "description": "", "schema": { "required": [ "count", "results" ], "type": "object", "properties": { "count": { "type": "integer" }, "next": { "type": "string", "format": "uri", "x-nullable": true }, "previous": { "type": "string", "format": "uri", "x-nullable": true }, "results": { "type": "array", "items": { "$ref": "#/definitions/AnswerReadOnly" } } } } } }, "tags": [ "tests" ] }, "post": { "operationId": "tests_questions_answers_create", "description": "", "parameters": [ { "name": "data", "in": "body", "required": true, "schema": { "$ref": "#/definitions/Answer" } } ], "responses": { "201": { "description": "", "schema": { "$ref": "#/definitions/Answer" } } }, "tags": [ "tests" ] }, "parameters": [ { "name": "question_pk", "in": "path", "required": true, "type": "string" }, { "name": "test_hash", "in": "path", "required": true, "type": "string" } ] }, "/tests/{test_hash}/questions/{question_pk}/answers/{id}/": { "get": { "operationId": "tests_questions_answers_read", "description": "", "parameters": [], "responses": { "200": { "description": "", "schema": { "$ref": "#/definitions/AnswerReadOnly" } } }, "tags": [ "tests" ] }, "put": { "operationId": "tests_questions_answers_update", "description": "", "parameters": [ { "name": "data", "in": "body", "required": true, "schema": { "$ref": "#/definitions/Answer" } } ], "responses": { "200": { "description": "", "schema": { "$ref": "#/definitions/Answer" } } }, "tags": [ "tests" ] }, "patch": { "operationId": "tests_questions_answers_partial_update", "description": "", "parameters": [ { "name": "data", "in": "body", "required": true, "schema": { "$ref": "#/definitions/Answer" } } ], "responses": { "200": { "description": "", "schema": { "$ref": "#/definitions/Answer" } } }, "tags": [ "tests" ] }, "delete": { "operationId": "tests_questions_answers_delete", "description": "", "parameters": [], "responses": { "204": { "description": "" } }, "tags": [ "tests" ] }, "parameters": [ { "name": "id", "in": "path", "description": "A unique integer value identifying this Answer.", "required": true, "type": "integer" }, { "name": "question_pk", "in": "path", "required": true, "type": "string" }, { "name": "test_hash", "in": "path", "required": true, "type": "string" } ] } }, "definitions": { "TokenObtainPair": { "required": [ "username", "password" ], "type": "object", "properties": { "username": { "title": "Username", "type": "string", "minLength": 1 }, "password": { "title": "Password", "type": "string", "minLength": 1 } } }, "TokenRefresh": { "required": [ "refresh" ], "type": "object", "properties": { "refresh": { "title": "Refresh", "type": "string", "minLength": 1 } } }, "TokenVerify": { "required": [ "token" ], "type": "object", "properties": { "token": { "title": "Token", "type": "string", "minLength": 1 } } }, "TestReadOnlyShort": { "required": [ "title" ], "type": "object", "properties": { "id": { "title": "ID", "type": "integer", "readOnly": true }, "url": { "title": "Url", "type": "string", "format": "uri", "readOnly": true }, "hash": { "title": "Hash", "type": "string", "maxLength": 64, "minLength": 1 }, "title": { "title": "Title", "type": "string", "maxLength": 256, "minLength": 1 }, "params": { "type": "array", "items": { "title": "Params", "type": "string", "maxLength": 256, "minLength": 1 } }, "stats_restriction": { "title": "Statistic restriction", "type": "string", "enum": [ "off", "any", "auth_only", "private" ] }, "owner": { "title": "Owner", "type": "string", "readOnly": true } } }, "Answer": { "required": [ "params_value" ], "type": "object", "properties": { "id": { "title": "ID", "type": "integer", "readOnly": true }, "position": { "title": "Position", "type": "integer", "maximum": 32767, "minimum": -32768 }, "params_value": { "type": "array", "items": { "title": "Params value", "type": "number" } } } }, "Question": { "required": [ "text", "answers" ], "type": "object", "properties": { "id": { "title": "ID", "type": "integer", "readOnly": true }, "position": { "title": "Position", "type": "integer", "maximum": 32767, "minimum": -32768 }, "text": { "title": "\u0422\u0435\u043a\u0441\u0442", "type": "string", "minLength": 1 }, "answers": { "type": "array", "items": { "$ref": "#/definitions/Answer" } } } }, "Test": { "required": [ "title", "description", "questions" ], "type": "object", "properties": { "id": { "title": "ID", "type": "integer", "readOnly": true }, "hash": { "title": "Hash", "type": "string", "readOnly": true, "minLength": 1 }, "title": { "title": "Title", "type": "string", "maxLength": 256, "minLength": 1 }, "description": { "title": "Description", "type": "string", "minLength": 1 }, "is_private": { "title": "Is private?", "type": "boolean" }, "params": { "type": "array", "items": { "title": "Params", "type": "string", "maxLength": 256, "minLength": 1 } }, "params_defaults": { "type": "array", "items": { "title": "Params defaults", "type": "number" } }, "stats_restriction": { "title": "Statistic restriction", "type": "string", "enum": [ "off", "any", "auth_only", "private" ] }, "stats_restriction_display": { "title": "Stats restriction display", "type": "string", "readOnly": true, "minLength": 1 }, "owner": { "title": "Owner", "type": "string", "readOnly": true }, "questions": { "type": "array", "items": { "$ref": "#/definitions/Question" } } } }, "AnswerReadOnly": { "required": [ "params_value" ], "type": "object", "properties": { "id": { "title": "ID", "type": "integer", "readOnly": true }, "position": { "title": "Position", "type": "integer", "maximum": 32767, "minimum": -32768 }, "params_value": { "type": "array", "items": { "title": "Params value", "type": "number" } } } }, "QuestionReadOnly": { "required": [ "text" ], "type": "object", "properties": { "id": { "title": "ID", "type": "integer", "readOnly": true }, "position": { "title": "Position", "type": "integer", "maximum": 32767, "minimum": -32768 }, "text": { "title": "\u0422\u0435\u043a\u0441\u0442", "type": "string", "minLength": 1 }, "answers": { "type": "array", "items": { "$ref": "#/definitions/AnswerReadOnly" }, "readOnly": true } } }, "TestReadOnly": { "required": [ "title", "description", "stats_restriction_display", "owner" ], "type": "object", "properties": { "id": { "title": "ID", "type": "integer", "readOnly": true }, "hash": { "title": "Hash", "type": "string", "maxLength": 64, "minLength": 1 }, "title": { "title": "Title", "type": "string", "maxLength": 256, "minLength": 1 }, "description": { "title": "Description", "type": "string", "minLength": 1 }, "is_private": { "title": "Is private?", "type": "boolean" }, "params": { "type": "array", "items": { "title": "Params", "type": "string", "maxLength": 256, "minLength": 1 } }, "params_defaults": { "type": "array", "items": { "title": "Params defaults", "type": "number" } }, "stats_restriction": { "title": "Statistic restriction", "type": "string", "enum": [ "off", "any", "auth_only", "private" ] }, "stats_restriction_display": { "title": "Stats restriction display", "type": "string", "minLength": 1 }, "owner": { "title": "Owner", "type": "integer" }, "questions": { "type": "array", "items": { "$ref": "#/definitions/QuestionReadOnly" }, "readOnly": true } } } } }