Djagger Toy Store (1.0.0)

Download OpenAPI specification:Download

E-mail: example@example.com License: MIT

This is a sample OpenAPI 3.0 schema generated from a Django project using Djagger.

View the Django project that generated this document on Github: https://github.com/royhzq/djagger-example.

Toy

Toy App

Update an existing toy

Update an existing Toy by Id

Request Body schema: application/json
optional

Toy Schema

id
integer (Id)
name
required
string (Name)
object (Category)

Toy Category

photoUrls
required
Array of strings (Photourls)
Array of objects (Tags)
status
string (Status)
Default: "available"
Enum: "available" "pending" "sold"

An enumeration.

Responses

Request samples

Content type
application/json
{
  • "id": 10,
  • "name": "doggie",
  • "category": {
    },
  • "photoUrls": [
    ],
  • "tags": [
    ],
  • "status": "available"
}

Response samples

Content type
application/json
{
  • "id": 10,
  • "name": "doggie",
  • "category": {
    },
  • "photoUrls": [
    ],
  • "tags": [
    ],
  • "status": "available"
}

Add a new toy to the store

Add a new Toy to the store

Request Body schema: application/json
optional

Toy Schema

id
integer (Id)
name
required
string (Name)
object (Category)

Toy Category

photoUrls
required
Array of strings (Photourls)
Array of objects (Tags)
status
string (Status)
Default: "available"
Enum: "available" "pending" "sold"

An enumeration.

Responses

Request samples

Content type
application/json
{
  • "id": 10,
  • "name": "doggie",
  • "category": {
    },
  • "photoUrls": [
    ],
  • "tags": [
    ],
  • "status": "available"
}

Response samples

Content type
application/json
{
  • "id": 10,
  • "name": "doggie",
  • "category": {
    },
  • "photoUrls": [
    ],
  • "tags": [
    ],
  • "status": "available"
}

Find Toys by status

Find Toys by status

query Parameters
status
string (status)
Default: "available"
Enum: "available" "pending" "sold"

Enum of status

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Find Toys by tags

Multiple tags can be provided with comma separated strings. e.g., ?tags=tag1,tag2

query Parameters
tags
Array of strings (tags)
Example: tags=Dog,Cat

Relevant tags

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Find Toy by ID

path Parameters
toyId
required
integer (toyId)

ID of Toy to return

Responses

Response samples

Content type
application/json
{
  • "id": 10,
  • "name": "doggie",
  • "category": {
    },
  • "photoUrls": [
    ],
  • "tags": [
    ],
  • "status": "available"
}

Update Toy with form data

path Parameters
toyId
required
integer (toyId)

ID of Toy to return

query Parameters
name
string (name)

Name of Toy to update

status
string (status)

Status of Toy to update

Responses

Response samples

Content type
application/json
{
  • "message": [
    ]
}

Deletes a Toy

path Parameters
toyId
required
integer (toyId)

ID of Toy to return

header Parameters
api_key
string (api_key)

Responses

Response samples

Content type
application/json
{
  • "message": [
    ]
}

Uploads an image

path Parameters
toyId
required
integer (toyId)

ID of Toy to return

query Parameters
additionalMetadata
string (additionalMetadata)
Request Body schema: application/octet-stream
optional
string <binary> (ToyUploadImageSchema)

Example values are not available for application/octet-stream media types.

Responses

Response samples

Content type
application/json
{
  • "code": 0,
  • "type": "string",
  • "message": "string"
}

Store

Store App

Returns toy inventories by status

Responses

Response samples

Content type
application/json
{
  • "property1": 0,
  • "property2": 0
}

Place an order for a toy

Request Body schema: application/json
optional
id
required
integer (Id)
toyId
required
integer (Toyid)
quantity
required
integer (Quantity)
shipDate
required
string <date-time> (Shipdate)
status
required
string (OrderStatus)
Enum: "placed" "approved" "delivered"

An enumeration.

complete
required
boolean (Complete)

Responses

Request samples

Content type
application/json
{
  • "id": 0,
  • "toyId": 0,
  • "quantity": 0,
  • "shipDate": "2019-08-24T14:15:22Z",
  • "status": "placed",
  • "complete": true
}

Response samples

Content type
application/json
{
  • "id": 0,
  • "toyId": 0,
  • "quantity": 0,
  • "shipDate": "2019-08-24T14:15:22Z",
  • "status": "placed",
  • "complete": true
}

Find purchase order by ID

path Parameters
orderId
required
integer (orderId)

ID of order that needs to be fetched

Responses

Response samples

Content type
application/json
{
  • "id": 0,
  • "toyId": 0,
  • "quantity": 0,
  • "shipDate": "2019-08-24T14:15:22Z",
  • "status": "placed",
  • "complete": true
}

Delete purchase order by ID

path Parameters
orderId
required
integer (orderId)

ID of order that needs to be fetched

Responses

Response samples

Content type
application/json
{ }

Blog

Blog App

RandomArticleAPI

Return a random article from the Blog

Responses

Response samples

Content type
application/json
{
  • "created": "2019-08-24T14:15:22Z",
  • "title": "string",
  • "author": "string",
  • "content": "string"
}

ArticleCreateAPI

Request Body schema: application/json
optional

POST schema for blog article creation

title
required
string (Title)

Title of Blog article

content
required
string (Content)

Blog article content

Responses

Request samples

Content type
application/json
{
  • "title": "string",
  • "content": "string"
}

Response samples

Content type
application/json
{
  • "created": "2019-08-24T14:15:22Z",
  • "title": "string",
  • "author": "string",
  • "content": "string"
}

ArticleUpdateAPI

Request Body schema: application/json
optional
pk
required
integer (Pk)

Primary key of article to update

title
string (Title)
content
string (Content)

Responses

Request samples

Content type
application/json
{
  • "pk": 0,
  • "title": "string",
  • "content": "string"
}

Response samples

Content type
application/json
{
  • "created": "2019-08-24T14:15:22Z",
  • "title": "string",
  • "author": "string",
  • "content": "string"
}

ArticleDeleteAPI

path Parameters
pk
required
integer (pk)

Primary key of article to delete

Responses

Response samples

Content type
application/json
{
  • "pk": 0
}

ArticlesYearAPI

List all articles given a year

path Parameters
year
required
integer (year)
query Parameters
page
integer (page)
cookie Parameters
username
string (username)
header Parameters
api_key
string (api_key)

Responses

Response samples

Content type
application/json
[
  • {
    }
]

ArticleDetailAPI

path Parameters
year
required
integer (year)
month
required
integer (month)
slug
required
string (slug)

Responses

Response samples

Content type
application/json
{
  • "created": "2019-08-24T14:15:22Z",
  • "title": "string",
  • "author": "string",
  • "content": "string"
}

List Authors

API to create an author or list all authors

Responses

Response samples

Content type
application/json
{
  • "authors": [
    ]
}

Create Author

API to create an author or list all authors

Request Body schema: application/json
optional
first_name
required
string (First Name)
last_name
required
string (Last Name)

Responses

Request samples

Content type
application/json
{
  • "first_name": "string",
  • "last_name": "string"
}

Response samples

Content type
application/json
{
  • "first_name": "string",
  • "last_name": "string"
}

Category List

Example Generic View Documentation

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Category List Create

Example Generic View Documentation

Responses

Response samples

Content type
application/json
[
  • {
    }
]

List Categories

Example Viewset documentation

Responses

Response samples

Content type
application/json
{
  • "name": [
    ]
}

List Categories

Example Viewset documentation

Responses

Response samples

Content type
application/json
{
  • "name": [
    ]
}

Get Category

Example Viewset documentation

Responses

Response samples

Content type
application/json
{
  • "name": "string"
}

Get Category

Example Viewset documentation

Responses

Response samples

Content type
application/json
{
  • "name": "string"
}

User

User App

Create user

This can only be done by the logged in user.

Request Body schema: application/json
optional

A User object

id
required
integer (Id)
username
required
string (Username)
firstName
required
string (Firstname)
lastName
required
string (Lastname)
email
required
string (Email)
password
required
string (Password)
phone
required
string (Phone)
userStatus
required
integer (Userstatus)

Responses

Request samples

Content type
application/json
{
  • "id": 10,
  • "username": "theUser",
  • "firstName": "John",
  • "lastName": "James",
  • "email": "john@email.com",
  • "password": "12345",
  • "phone": "12345",
  • "userStatus": 4
}

Response samples

Content type
application/json
{
  • "id": 10,
  • "username": "theUser",
  • "firstName": "John",
  • "lastName": "James",
  • "email": "john@email.com",
  • "password": "12345",
  • "phone": "12345",
  • "userStatus": 4
}

Create array of Users

Creates list of users with given input array

Request Body schema: application/json
optional

Array of User objects

Array
id
required
integer (Id)
username
required
string (Username)
firstName
required
string (Firstname)
lastName
required
string (Lastname)
email
required
string (Email)
password
required
string (Password)
phone
required
string (Phone)
userStatus
required
integer (Userstatus)

Responses

Request samples

Content type
application/json
[
  • {
    }
]

Response samples

Content type
application/json
[
  • {
    }
]

Logs user into the system

query Parameters
username
string (username)
password
string (password)

The password for login in clear text

Responses

Response samples

Content type
application/json
"string"

Logs out a User

Logs current user session out of the system

Responses

Response samples

Content type
application/json
"string"

Get User

Retrieve a User by username

path Parameters
username
required
string (username)

The username of the User that needs to be fetched.

Responses

Response samples

Content type
application/json
{
  • "id": 10,
  • "username": "theUser",
  • "firstName": "John",
  • "lastName": "James",
  • "email": "john@email.com",
  • "password": "12345",
  • "phone": "12345",
  • "userStatus": 4
}

Update User

Update a User by username

path Parameters
username
required
string (username)

The username of the User that needs to be fetched.

Responses

Response samples

Content type
application/json
{
  • "id": 10,
  • "username": "theUser",
  • "firstName": "John",
  • "lastName": "James",
  • "email": "john@email.com",
  • "password": "12345",
  • "phone": "12345",
  • "userStatus": 4
}

Delete User

Delete a User by username

path Parameters
username
required
string (username)

The username of the User that needs to be fetched.

Responses

Response samples

Content type
application/json
{
  • "msg": [
    ]
}