Skip to content

Instantly share code, notes, and snippets.

@andresmachado
Last active June 24, 2020 18:23
Show Gist options
  • Save andresmachado/4a3c7de7ecffbe6d85fd2fc761e84163 to your computer and use it in GitHub Desktop.
Save andresmachado/4a3c7de7ecffbe6d85fd2fc761e84163 to your computer and use it in GitHub Desktop.
[
{
"swagger": "2.0",
"info": {
"title": "TestePermissions API",
"description": "API documentation for TestePermissions App",
"version": "v1",
},
"host": "testepermissions_15043.herokuapp.com",
"schemes": ["https"],
"basePath": "/",
"consumes": ["application/json"],
"produces": ["application/json"],
"securityDefinitions": {"Basic": {"type": "basic"}},
"security": [{"Basic": []}],
"paths": {
"/api/v1/customtext/": {
"get": {
"operationId": "api_v1_customtext_list",
"description": "",
"parameters": [],
"responses": {
"200": {
"description": "",
"schema": {
"type": "array",
"items": {"$ref": "#/definitions/CustomText"},
},
}
},
"tags": ["api"],
},
"parameters": [],
},
"/api/v1/customtext/{id}/": {
"get": {
"operationId": "api_v1_customtext_read",
"description": "",
"parameters": [],
"responses": {
"200": {
"description": "",
"schema": {"$ref": "#/definitions/CustomText"},
}
},
"tags": ["api"],
},
"put": {
"operationId": "api_v1_customtext_update",
"description": "",
"parameters": [
{
"name": "data",
"in": "body",
"required": true,
"schema": {"$ref": "#/definitions/CustomText"},
}
],
"responses": {
"200": {
"description": "",
"schema": {"$ref": "#/definitions/CustomText"},
}
},
"tags": ["api"],
},
"patch": {
"operationId": "api_v1_customtext_partial_update",
"description": "",
"parameters": [
{
"name": "data",
"in": "body",
"required": true,
"schema": {"$ref": "#/definitions/CustomText"},
}
],
"responses": {
"200": {
"description": "",
"schema": {"$ref": "#/definitions/CustomText"},
}
},
"tags": ["api"],
},
"parameters": [
{
"name": "id",
"in": "path",
"description": "A unique integer value identifying this custom text.",
"required": true,
"type": "integer",
}
],
},
"/api/v1/homepage/": {
"get": {
"operationId": "api_v1_homepage_list",
"description": "",
"parameters": [],
"responses": {
"200": {
"description": "",
"schema": {
"type": "array",
"items": {"$ref": "#/definitions/HomePage"},
},
}
},
"tags": ["api"],
},
"parameters": [],
},
"/api/v1/homepage/{id}/": {
"get": {
"operationId": "api_v1_homepage_read",
"description": "",
"parameters": [],
"responses": {
"200": {
"description": "",
"schema": {"$ref": "#/definitions/HomePage"},
}
},
"tags": ["api"],
},
"put": {
"operationId": "api_v1_homepage_update",
"description": "",
"parameters": [
{
"name": "data",
"in": "body",
"required": true,
"schema": {"$ref": "#/definitions/HomePage"},
}
],
"responses": {
"200": {
"description": "",
"schema": {"$ref": "#/definitions/HomePage"},
}
},
"tags": ["api"],
},
"patch": {
"operationId": "api_v1_homepage_partial_update",
"description": "",
"parameters": [
{
"name": "data",
"in": "body",
"required": true,
"schema": {"$ref": "#/definitions/HomePage"},
}
],
"responses": {
"200": {
"description": "",
"schema": {"$ref": "#/definitions/HomePage"},
}
},
"tags": ["api"],
},
"parameters": [
{
"name": "id",
"in": "path",
"description": "A unique integer value identifying this home page.",
"required": true,
"type": "integer",
}
],
},
"/api/v1/login/": {
"post": {
"operationId": "api_v1_login_create",
"description": "Based on rest_framework.authtoken.views.ObtainAuthToken",
"parameters": [],
"responses": {"201": {"description": ""}},
"tags": ["api"],
},
"parameters": [],
},
"/api/v1/signup/": {
"post": {
"operationId": "api_v1_signup_create",
"description": "",
"parameters": [
{
"name": "data",
"in": "body",
"required": true,
"schema": {"$ref": "#/definitions/Signup"},
}
],
"responses": {
"201": {
"description": "",
"schema": {"$ref": "#/definitions/Signup"},
}
},
"tags": ["api"],
},
"parameters": [],
},
"/rest-auth/login/": {
"post": {
"operationId": "rest-auth_login_create",
"description": "Check the credentials and return the REST Token\nif the credentials are valid and authenticated.\nCalls Django Auth login method to register User ID\nin Django session framework\n\nAccept the following POST parameters: username, password\nReturn the REST Framework Token Object's key.",
"parameters": [
{
"name": "data",
"in": "body",
"required": true,
"schema": {"$ref": "#/definitions/Login"},
}
],
"responses": {
"201": {
"description": "",
"schema": {"$ref": "#/definitions/Login"},
}
},
"tags": ["rest-auth"],
},
"parameters": [],
},
"/rest-auth/logout/": {
"get": {
"operationId": "rest-auth_logout_list",
"summary": "Calls Django logout method and delete the Token object\nassigned to the current User object.",
"description": "Accepts/Returns nothing.",
"parameters": [],
"responses": {"200": {"description": ""}},
"tags": ["rest-auth"],
},
"post": {
"operationId": "rest-auth_logout_create",
"summary": "Calls Django logout method and delete the Token object\nassigned to the current User object.",
"description": "Accepts/Returns nothing.",
"parameters": [],
"responses": {"201": {"description": ""}},
"tags": ["rest-auth"],
},
"parameters": [],
},
"/rest-auth/password/change/": {
"post": {
"operationId": "rest-auth_password_change_create",
"summary": "Calls Django Auth SetPasswordForm save method.",
"description": "Accepts the following POST parameters: new_password1, new_password2\nReturns the success/fail message.",
"parameters": [
{
"name": "data",
"in": "body",
"required": true,
"schema": {"$ref": "#/definitions/PasswordChange"},
}
],
"responses": {
"201": {
"description": "",
"schema": {"$ref": "#/definitions/PasswordChange"},
}
},
"tags": ["rest-auth"],
},
"parameters": [],
},
"/rest-auth/password/reset/": {
"post": {
"operationId": "rest-auth_password_reset_create",
"summary": "Calls Django Auth PasswordResetForm save method.",
"description": "Accepts the following POST parameters: email\nReturns the success/fail message.",
"parameters": [
{
"name": "data",
"in": "body",
"required": true,
"schema": {"$ref": "#/definitions/Password"},
}
],
"responses": {
"201": {
"description": "",
"schema": {"$ref": "#/definitions/Password"},
}
},
"tags": ["rest-auth"],
},
"parameters": [],
},
"/rest-auth/password/reset/confirm/": {
"post": {
"operationId": "rest-auth_password_reset_confirm_create",
"summary": "Password reset e-mail link is confirmed, therefore\nthis resets the user's password.",
"description": "Accepts the following POST parameters: token, uid,\n new_password1, new_password2\nReturns the success/fail message.",
"parameters": [
{
"name": "data",
"in": "body",
"required": true,
"schema": {"$ref": "#/definitions/PasswordResetConfirm"},
}
],
"responses": {
"201": {
"description": "",
"schema": {"$ref": "#/definitions/PasswordResetConfirm"},
}
},
"tags": ["rest-auth"],
},
"parameters": [],
},
"/rest-auth/registration/": {
"post": {
"operationId": "rest-auth_registration_create",
"description": "",
"parameters": [
{
"name": "data",
"in": "body",
"required": true,
"schema": {"$ref": "#/definitions/Signup"},
}
],
"responses": {
"201": {
"description": "",
"schema": {"$ref": "#/definitions/Signup"},
}
},
"tags": ["rest-auth"],
},
"parameters": [],
},
"/rest-auth/registration/verify-email/": {
"post": {
"operationId": "rest-auth_registration_verify-email_create",
"description": "",
"parameters": [
{
"name": "data",
"in": "body",
"required": true,
"schema": {"$ref": "#/definitions/VerifyEmail"},
}
],
"responses": {
"201": {
"description": "",
"schema": {"$ref": "#/definitions/VerifyEmail"},
}
},
"tags": ["rest-auth"],
},
"parameters": [],
},
"/rest-auth/user/": {
"get": {
"operationId": "rest-auth_user_read",
"summary": "Reads and updates UserModel fields\nAccepts GET, PUT, PATCH methods.",
"description": "Default accepted fields: username, first_name, last_name\nDefault display fields: pk, username, email, first_name, last_name\nRead-only fields: pk, email\n\nReturns UserModel fields.",
"parameters": [],
"responses": {
"200": {
"description": "",
"schema": {"$ref": "#/definitions/UserDetails"},
}
},
"tags": ["rest-auth"],
},
"put": {
"operationId": "rest-auth_user_update",
"summary": "Reads and updates UserModel fields\nAccepts GET, PUT, PATCH methods.",
"description": "Default accepted fields: username, first_name, last_name\nDefault display fields: pk, username, email, first_name, last_name\nRead-only fields: pk, email\n\nReturns UserModel fields.",
"parameters": [
{
"name": "data",
"in": "body",
"required": true,
"schema": {"$ref": "#/definitions/UserDetails"},
}
],
"responses": {
"200": {
"description": "",
"schema": {"$ref": "#/definitions/UserDetails"},
}
},
"tags": ["rest-auth"],
},
"patch": {
"operationId": "rest-auth_user_partial_update",
"summary": "Reads and updates UserModel fields\nAccepts GET, PUT, PATCH methods.",
"description": "Default accepted fields: username, first_name, last_name\nDefault display fields: pk, username, email, first_name, last_name\nRead-only fields: pk, email\n\nReturns UserModel fields.",
"parameters": [
{
"name": "data",
"in": "body",
"required": true,
"schema": {"$ref": "#/definitions/UserDetails"},
}
],
"responses": {
"200": {
"description": "",
"schema": {"$ref": "#/definitions/UserDetails"},
}
},
"tags": ["rest-auth"],
},
"parameters": [],
},
},
"definitions": {
"CustomText": {
"required": ["title"],
"type": "object",
"properties": {
"id": {"title": "ID", "type": "integer", "readOnly": true},
"title": {
"title": "Title",
"type": "string",
"maxLength": 150,
"minLength": 1,
},
},
},
"HomePage": {
"required": ["body"],
"type": "object",
"properties": {
"id": {"title": "ID", "type": "integer", "readOnly": true},
"body": {"title": "Body", "type": "string", "minLength": 1},
"test_commit": {
"title": "Test commit",
"type": "string",
"maxLength": 256,
"x-nullable": true,
},
"commit_2": {
"title": "Commit 2",
"type": "integer",
"maximum": 2147483647,
"minimum": -2147483648,
"x-nullable": true,
},
"commit_3": {
"title": "Commit 3",
"type": "number",
"x-nullable": true,
},
"commit_4": {
"title": "Commit 4",
"type": "string",
"format": "date",
"x-nullable": true,
},
},
},
"Signup": {
"required": ["email", "password"],
"type": "object",
"properties": {
"id": {"title": "ID", "type": "integer", "readOnly": true},
"name": {
"title": "Name",
"type": "string",
"maxLength": 255,
"x-nullable": true,
},
"email": {
"title": "Email address",
"type": "string",
"format": "email",
"maxLength": 254,
"minLength": 1,
},
"password": {
"title": "Password",
"type": "string",
"maxLength": 128,
"minLength": 1,
},
},
},
"Login": {
"required": ["password"],
"type": "object",
"properties": {
"username": {"title": "Username", "type": "string"},
"email": {"title": "Email", "type": "string", "format": "email"},
"password": {"title": "Password", "type": "string", "minLength": 1},
},
},
"PasswordChange": {
"required": ["new_password1", "new_password2"],
"type": "object",
"properties": {
"new_password1": {
"title": "New password1",
"type": "string",
"maxLength": 128,
"minLength": 1,
},
"new_password2": {
"title": "New password2",
"type": "string",
"maxLength": 128,
"minLength": 1,
},
},
},
"Password": {
"required": ["email"],
"type": "object",
"properties": {
"email": {
"title": "Email",
"type": "string",
"format": "email",
"minLength": 1,
}
},
},
"PasswordResetConfirm": {
"required": ["new_password1", "new_password2", "uid", "token"],
"type": "object",
"properties": {
"new_password1": {
"title": "New password1",
"type": "string",
"maxLength": 128,
"minLength": 1,
},
"new_password2": {
"title": "New password2",
"type": "string",
"maxLength": 128,
"minLength": 1,
},
"uid": {"title": "Uid", "type": "string", "minLength": 1},
"token": {"title": "Token", "type": "string", "minLength": 1},
},
},
"VerifyEmail": {
"required": ["key"],
"type": "object",
"properties": {
"key": {"title": "Key", "type": "string", "minLength": 1}
},
},
"UserDetails": {
"required": ["username"],
"type": "object",
"properties": {
"pk": {"title": "ID", "type": "integer", "readOnly": true},
"username": {
"title": "Username",
"description": "Required. 150 characters or fewer. Letters, digits and @/./+/-/_ only.",
"type": "string",
"pattern": "^[\\w.@+-]+$",
"maxLength": 150,
"minLength": 1,
},
"email": {
"title": "Email address",
"type": "string",
"format": "email",
"readOnly": true,
"minLength": 1,
},
"first_name": {
"title": "First name",
"type": "string",
"maxLength": 30,
},
"last_name": {
"title": "Last name",
"type": "string",
"maxLength": 150,
},
},
},
},
}
]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment