Product API Docs

This commit is contained in:
David Bomba 2023-02-18 12:22:48 +11:00
parent f0c4e4a614
commit d8bdb0c2fd
4 changed files with 945 additions and 913 deletions

File diff suppressed because it is too large Load Diff

View File

@ -6840,415 +6840,7 @@ paths:
application/json: application/json:
schema: schema:
$ref: '#/components/schemas/Error' $ref: '#/components/schemas/Error'
/api/v1/products:
get:
tags:
- products
summary: 'Gets a list of products'
description: "Lists products, search and filters allow fine grained lists to be generated.\n\n Query parameters can be added to performed more fine grained filtering of the products, these are handled by the ProductFilters class which defines the methods available"
operationId: getProducts
parameters:
-
$ref: '#/components/parameters/X-API-TOKEN'
-
$ref: '#/components/parameters/X-Requested-With'
-
$ref: '#/components/parameters/include'
responses:
200:
description: 'A list of products'
headers:
X-MINIMUM-CLIENT-VERSION:
$ref: '#/components/headers/X-MINIMUM-CLIENT-VERSION'
X-RateLimit-Remaining:
$ref: '#/components/headers/X-RateLimit-Remaining'
X-RateLimit-Limit:
$ref: '#/components/headers/X-RateLimit-Limit'
content:
application/json:
schema:
$ref: '#/components/schemas/Product'
422:
description: 'Validation error'
content:
application/json:
schema:
$ref: '#/components/schemas/ValidationError'
default:
description: 'Unexpected Error'
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
post:
tags:
- products
summary: 'Adds a Product'
description: 'Adds an Product to the system'
operationId: storeProduct
parameters:
-
$ref: '#/components/parameters/X-API-TOKEN'
-
$ref: '#/components/parameters/X-Requested-With'
-
$ref: '#/components/parameters/include'
responses:
200:
description: 'Returns the saved Product object'
headers:
X-MINIMUM-CLIENT-VERSION:
$ref: '#/components/headers/X-MINIMUM-CLIENT-VERSION'
X-RateLimit-Remaining:
$ref: '#/components/headers/X-RateLimit-Remaining'
X-RateLimit-Limit:
$ref: '#/components/headers/X-RateLimit-Limit'
content:
application/json:
schema:
$ref: '#/components/schemas/Product'
422:
description: 'Validation error'
content:
application/json:
schema:
$ref: '#/components/schemas/ValidationError'
default:
description: 'Unexpected Error'
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
/api/v1/products/create:
get:
tags:
- products
summary: 'Gets a new blank Product object'
description: 'Returns a blank object with default values'
operationId: getProductsCreate
parameters:
-
$ref: '#/components/parameters/X-API-TOKEN'
-
$ref: '#/components/parameters/X-Requested-With'
-
$ref: '#/components/parameters/include'
responses:
200:
description: 'A blank Product object'
headers:
X-MINIMUM-CLIENT-VERSION:
$ref: '#/components/headers/X-MINIMUM-CLIENT-VERSION'
X-RateLimit-Remaining:
$ref: '#/components/headers/X-RateLimit-Remaining'
X-RateLimit-Limit:
$ref: '#/components/headers/X-RateLimit-Limit'
content:
application/json:
schema:
$ref: '#/components/schemas/Product'
422:
description: 'Validation error'
content:
application/json:
schema:
$ref: '#/components/schemas/ValidationError'
default:
description: 'Unexpected Error'
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
'/api/v1/products/{id}':
get:
tags:
- products
summary: 'Shows an Product'
description: 'Displays an Product by id'
operationId: showProduct
parameters:
-
$ref: '#/components/parameters/X-API-TOKEN'
-
$ref: '#/components/parameters/X-Requested-With'
-
$ref: '#/components/parameters/include'
-
name: id
in: path
description: 'The Product Hashed ID'
required: true
schema:
type: string
format: string
example: D2J234DFA
responses:
200:
description: 'Returns the Product object'
headers:
X-MINIMUM-CLIENT-VERSION:
$ref: '#/components/headers/X-MINIMUM-CLIENT-VERSION'
X-RateLimit-Remaining:
$ref: '#/components/headers/X-RateLimit-Remaining'
X-RateLimit-Limit:
$ref: '#/components/headers/X-RateLimit-Limit'
content:
application/json:
schema:
$ref: '#/components/schemas/Product'
422:
description: 'Validation error'
content:
application/json:
schema:
$ref: '#/components/schemas/ValidationError'
default:
description: 'Unexpected Error'
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
put:
tags:
- products
summary: 'Updates an Product'
description: 'Handles the updating of an Product by id'
operationId: updateProduct
parameters:
-
$ref: '#/components/parameters/X-API-TOKEN'
-
$ref: '#/components/parameters/X-Requested-With'
-
$ref: '#/components/parameters/include'
-
name: id
in: path
description: 'The Product Hashed ID'
required: true
schema:
type: string
format: string
example: D2J234DFA
responses:
200:
description: 'Returns the Product object'
headers:
X-MINIMUM-CLIENT-VERSION:
$ref: '#/components/headers/X-MINIMUM-CLIENT-VERSION'
X-RateLimit-Remaining:
$ref: '#/components/headers/X-RateLimit-Remaining'
X-RateLimit-Limit:
$ref: '#/components/headers/X-RateLimit-Limit'
content:
application/json:
schema:
$ref: '#/components/schemas/Product'
422:
description: 'Validation error'
content:
application/json:
schema:
$ref: '#/components/schemas/ValidationError'
default:
description: 'Unexpected Error'
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
delete:
tags:
- products
summary: 'Deletes a Product'
description: 'Handles the deletion of an Product by id'
operationId: deleteProduct
parameters:
-
$ref: '#/components/parameters/X-API-TOKEN'
-
$ref: '#/components/parameters/X-Requested-With'
-
$ref: '#/components/parameters/include'
-
name: id
in: path
description: 'The Product Hashed ID'
required: true
schema:
type: string
format: string
example: D2J234DFA
responses:
200:
description: 'Returns a HTTP status'
headers:
X-MINIMUM-CLIENT-VERSION:
$ref: '#/components/headers/X-MINIMUM-CLIENT-VERSION'
X-RateLimit-Remaining:
$ref: '#/components/headers/X-RateLimit-Remaining'
X-RateLimit-Limit:
$ref: '#/components/headers/X-RateLimit-Limit'
422:
description: 'Validation error'
content:
application/json:
schema:
$ref: '#/components/schemas/ValidationError'
default:
description: 'Unexpected Error'
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
'/api/v1/products/{id}/edit':
get:
tags:
- products
summary: 'Shows an Product for editting'
description: 'Displays an Product by id'
operationId: editProduct
parameters:
-
$ref: '#/components/parameters/X-API-TOKEN'
-
$ref: '#/components/parameters/X-Requested-With'
-
$ref: '#/components/parameters/include'
-
name: id
in: path
description: 'The Product Hashed ID'
required: true
schema:
type: string
format: string
example: D2J234DFA
responses:
200:
description: 'Returns the Product object'
headers:
X-MINIMUM-CLIENT-VERSION:
$ref: '#/components/headers/X-MINIMUM-CLIENT-VERSION'
X-RateLimit-Remaining:
$ref: '#/components/headers/X-RateLimit-Remaining'
X-RateLimit-Limit:
$ref: '#/components/headers/X-RateLimit-Limit'
content:
application/json:
schema:
$ref: '#/components/schemas/Product'
422:
description: 'Validation error'
content:
application/json:
schema:
$ref: '#/components/schemas/ValidationError'
default:
description: 'Unexpected Error'
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
/api/v1/products/bulk:
post:
tags:
- products
summary: 'Performs bulk actions on an array of products'
description: ''
operationId: bulkProducts
parameters:
-
$ref: '#/components/parameters/X-API-TOKEN'
-
$ref: '#/components/parameters/X-Requested-With'
-
$ref: '#/components/parameters/index'
requestBody:
description: 'Hashed IDs'
required: true
content:
application/json:
schema:
type: array
items:
description: 'Array of hashed IDs to be bulk ''actioned'
type: integer
example: '[0,1,2,3]'
responses:
200:
description: 'The Product response'
headers:
X-MINIMUM-CLIENT-VERSION:
$ref: '#/components/headers/X-MINIMUM-CLIENT-VERSION'
X-RateLimit-Remaining:
$ref: '#/components/headers/X-RateLimit-Remaining'
X-RateLimit-Limit:
$ref: '#/components/headers/X-RateLimit-Limit'
content:
application/json:
schema:
$ref: '#/components/schemas/Product'
422:
description: 'Validation error'
content:
application/json:
schema:
$ref: '#/components/schemas/ValidationError'
default:
description: 'Unexpected Error'
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
'/api/v1/products/{id}/upload':
put:
tags:
- products
summary: 'Uploads a document to a product'
description: 'Handles the uploading of a document to a product'
operationId: uploadProduct
parameters:
-
$ref: '#/components/parameters/X-API-TOKEN'
-
$ref: '#/components/parameters/X-Requested-With'
-
$ref: '#/components/parameters/include'
-
name: id
in: path
description: 'The Product Hashed ID'
required: true
schema:
type: string
format: string
example: D2J234DFA
responses:
200:
description: 'Returns the Product object'
headers:
X-MINIMUM-CLIENT-VERSION:
$ref: '#/components/headers/X-MINIMUM-CLIENT-VERSION'
X-RateLimit-Remaining:
$ref: '#/components/headers/X-RateLimit-Remaining'
X-RateLimit-Limit:
$ref: '#/components/headers/X-RateLimit-Limit'
content:
application/json:
schema:
$ref: '#/components/schemas/Product'
422:
description: 'Validation error'
content:
application/json:
schema:
$ref: '#/components/schemas/ValidationError'
default:
description: 'Unexpected Error'
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
/api/v1/projects: /api/v1/projects:
get: get:
tags: tags:

View File

@ -527,7 +527,7 @@
tags: tags:
- clients - clients
summary: 'Add client document' summary: 'Add client document'
description: 'Handles the uploading of a document to a client' description: 'Handles the uploading of a document to a client, please note due to a quirk in REST you will need to use a _method parameter with value of POST'
operationId: uploadClient operationId: uploadClient
parameters: parameters:
- -
@ -545,6 +545,21 @@
type: string type: string
format: string format: string
example: D2J234DFA example: D2J234DFA
produces:
- application/json
requestBody:
required: true
content:
multipart/form-data:
schema:
type: object
properties:
_method:
type: string
example: POST
documents:
type: array
format: binary
responses: responses:
200: 200:
description: 'Returns the client object' description: 'Returns the client object'

409
openapi/paths/products.yaml Normal file
View File

@ -0,0 +1,409 @@
/api/v1/products:
get:
tags:
- products
summary: 'List products'
description: "Lists products, search and filters allow fine grained lists to be generated.\n\n Query parameters can be added to performed more fine grained filtering of the products, these are handled by the ProductFilters class which defines the methods available"
operationId: getProducts
parameters:
-
$ref: '#/components/parameters/X-API-TOKEN'
-
$ref: '#/components/parameters/X-Requested-With'
-
$ref: '#/components/parameters/include'
responses:
200:
description: 'A list of products'
headers:
X-MINIMUM-CLIENT-VERSION:
$ref: '#/components/headers/X-MINIMUM-CLIENT-VERSION'
X-RateLimit-Remaining:
$ref: '#/components/headers/X-RateLimit-Remaining'
X-RateLimit-Limit:
$ref: '#/components/headers/X-RateLimit-Limit'
content:
application/json:
schema:
$ref: '#/components/schemas/Product'
422:
description: 'Validation error'
content:
application/json:
schema:
$ref: '#/components/schemas/ValidationError'
default:
description: 'Unexpected Error'
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
post:
tags:
- products
summary: 'Create Product'
description: 'Adds an Product to the system'
operationId: storeProduct
parameters:
-
$ref: '#/components/parameters/X-API-TOKEN'
-
$ref: '#/components/parameters/X-Requested-With'
-
$ref: '#/components/parameters/include'
responses:
200:
description: 'Returns the saved Product object'
headers:
X-MINIMUM-CLIENT-VERSION:
$ref: '#/components/headers/X-MINIMUM-CLIENT-VERSION'
X-RateLimit-Remaining:
$ref: '#/components/headers/X-RateLimit-Remaining'
X-RateLimit-Limit:
$ref: '#/components/headers/X-RateLimit-Limit'
content:
application/json:
schema:
$ref: '#/components/schemas/Product'
422:
description: 'Validation error'
content:
application/json:
schema:
$ref: '#/components/schemas/ValidationError'
default:
description: 'Unexpected Error'
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
/api/v1/products/create:
get:
tags:
- products
summary: 'Create product'
description: 'Returns a blank object with default values'
operationId: getProductsCreate
parameters:
-
$ref: '#/components/parameters/X-API-TOKEN'
-
$ref: '#/components/parameters/X-Requested-With'
-
$ref: '#/components/parameters/include'
responses:
200:
description: 'A blank Product object'
headers:
X-MINIMUM-CLIENT-VERSION:
$ref: '#/components/headers/X-MINIMUM-CLIENT-VERSION'
X-RateLimit-Remaining:
$ref: '#/components/headers/X-RateLimit-Remaining'
X-RateLimit-Limit:
$ref: '#/components/headers/X-RateLimit-Limit'
content:
application/json:
schema:
$ref: '#/components/schemas/Product'
422:
description: 'Validation error'
content:
application/json:
schema:
$ref: '#/components/schemas/ValidationError'
default:
description: 'Unexpected Error'
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
'/api/v1/products/{id}':
get:
tags:
- products
summary: 'Show product'
description: 'Displays an Product by id'
operationId: showProduct
parameters:
-
$ref: '#/components/parameters/X-API-TOKEN'
-
$ref: '#/components/parameters/X-Requested-With'
-
$ref: '#/components/parameters/include'
-
name: id
in: path
description: 'The Product Hashed ID'
required: true
schema:
type: string
format: string
example: D2J234DFA
responses:
200:
description: 'Returns the Product object'
headers:
X-MINIMUM-CLIENT-VERSION:
$ref: '#/components/headers/X-MINIMUM-CLIENT-VERSION'
X-RateLimit-Remaining:
$ref: '#/components/headers/X-RateLimit-Remaining'
X-RateLimit-Limit:
$ref: '#/components/headers/X-RateLimit-Limit'
content:
application/json:
schema:
$ref: '#/components/schemas/Product'
422:
description: 'Validation error'
content:
application/json:
schema:
$ref: '#/components/schemas/ValidationError'
default:
description: 'Unexpected Error'
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
put:
tags:
- products
summary: 'Update product'
description: 'Handles the updating of an Product by id'
operationId: updateProduct
parameters:
-
$ref: '#/components/parameters/X-API-TOKEN'
-
$ref: '#/components/parameters/X-Requested-With'
-
$ref: '#/components/parameters/include'
-
name: id
in: path
description: 'The Product Hashed ID'
required: true
schema:
type: string
format: string
example: D2J234DFA
responses:
200:
description: 'Returns the Product object'
headers:
X-MINIMUM-CLIENT-VERSION:
$ref: '#/components/headers/X-MINIMUM-CLIENT-VERSION'
X-RateLimit-Remaining:
$ref: '#/components/headers/X-RateLimit-Remaining'
X-RateLimit-Limit:
$ref: '#/components/headers/X-RateLimit-Limit'
content:
application/json:
schema:
$ref: '#/components/schemas/Product'
422:
description: 'Validation error'
content:
application/json:
schema:
$ref: '#/components/schemas/ValidationError'
default:
description: 'Unexpected Error'
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
delete:
tags:
- products
summary: 'Delete product'
description: 'Handles the deletion of an Product by id'
operationId: deleteProduct
parameters:
-
$ref: '#/components/parameters/X-API-TOKEN'
-
$ref: '#/components/parameters/X-Requested-With'
-
$ref: '#/components/parameters/include'
-
name: id
in: path
description: 'The Product Hashed ID'
required: true
schema:
type: string
format: string
example: D2J234DFA
responses:
200:
description: 'Returns a HTTP status'
headers:
X-MINIMUM-CLIENT-VERSION:
$ref: '#/components/headers/X-MINIMUM-CLIENT-VERSION'
X-RateLimit-Remaining:
$ref: '#/components/headers/X-RateLimit-Remaining'
X-RateLimit-Limit:
$ref: '#/components/headers/X-RateLimit-Limit'
422:
description: 'Validation error'
content:
application/json:
schema:
$ref: '#/components/schemas/ValidationError'
default:
description: 'Unexpected Error'
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
'/api/v1/products/{id}/edit':
get:
tags:
- products
summary: 'Show product'
description: 'Displays an Product by id'
operationId: editProduct
parameters:
-
$ref: '#/components/parameters/X-API-TOKEN'
-
$ref: '#/components/parameters/X-Requested-With'
-
$ref: '#/components/parameters/include'
-
name: id
in: path
description: 'The Product Hashed ID'
required: true
schema:
type: string
format: string
example: D2J234DFA
responses:
200:
description: 'Returns the Product object'
headers:
X-MINIMUM-CLIENT-VERSION:
$ref: '#/components/headers/X-MINIMUM-CLIENT-VERSION'
X-RateLimit-Remaining:
$ref: '#/components/headers/X-RateLimit-Remaining'
X-RateLimit-Limit:
$ref: '#/components/headers/X-RateLimit-Limit'
content:
application/json:
schema:
$ref: '#/components/schemas/Product'
422:
description: 'Validation error'
content:
application/json:
schema:
$ref: '#/components/schemas/ValidationError'
default:
description: 'Unexpected Error'
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
/api/v1/products/bulk:
post:
tags:
- products
summary: 'Bulk product actions'
description: ''
operationId: bulkProducts
parameters:
-
$ref: '#/components/parameters/X-API-TOKEN'
-
$ref: '#/components/parameters/X-Requested-With'
-
$ref: '#/components/parameters/index'
requestBody:
description: 'Hashed IDs'
required: true
content:
application/json:
schema:
type: array
items:
description: 'Array of hashed IDs to be bulk ''actioned'
type: integer
example: '[0,1,2,3]'
responses:
200:
description: 'The Product response'
headers:
X-MINIMUM-CLIENT-VERSION:
$ref: '#/components/headers/X-MINIMUM-CLIENT-VERSION'
X-RateLimit-Remaining:
$ref: '#/components/headers/X-RateLimit-Remaining'
X-RateLimit-Limit:
$ref: '#/components/headers/X-RateLimit-Limit'
content:
application/json:
schema:
$ref: '#/components/schemas/Product'
422:
description: 'Validation error'
content:
application/json:
schema:
$ref: '#/components/schemas/ValidationError'
default:
description: 'Unexpected Error'
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
'/api/v1/products/{id}/upload':
put:
tags:
- products
summary: 'Add product document'
description: 'Handles the uploading of a document to a product'
operationId: uploadProduct
parameters:
-
$ref: '#/components/parameters/X-API-TOKEN'
-
$ref: '#/components/parameters/X-Requested-With'
-
$ref: '#/components/parameters/include'
-
name: id
in: path
description: 'The Product Hashed ID'
required: true
schema:
type: string
format: string
example: D2J234DFA
responses:
200:
description: 'Returns the Product object'
headers:
X-MINIMUM-CLIENT-VERSION:
$ref: '#/components/headers/X-MINIMUM-CLIENT-VERSION'
X-RateLimit-Remaining:
$ref: '#/components/headers/X-RateLimit-Remaining'
X-RateLimit-Limit:
$ref: '#/components/headers/X-RateLimit-Limit'
content:
application/json:
schema:
$ref: '#/components/schemas/Product'
422:
description: 'Validation error'
content:
application/json:
schema:
$ref: '#/components/schemas/ValidationError'
default:
description: 'Unexpected Error'
content:
application/json:
schema:
$ref: '#/components/schemas/Error'