Fixes for openapi spec

This commit is contained in:
David Bomba 2024-02-10 15:56:31 +11:00
parent 958e0bbfc6
commit 2c25371011
15 changed files with 7447 additions and 7450 deletions

View File

@ -79,6 +79,7 @@ class OpenApiYaml extends Command
Storage::disk('base')->append('/openapi/api-docs.yaml', file_get_contents($path.'/components.yaml'));
Storage::disk('base')->append('/openapi/api-docs.yaml', file_get_contents($path.'/components/examples.yaml'));
Storage::disk('base')->append('/openapi/api-docs.yaml', file_get_contents($path.'/components/responses.yaml'));
$directory = new DirectoryIterator($path . '/components/responses/');

File diff suppressed because it is too large Load Diff

View File

@ -12,7 +12,6 @@ components:
description: 'The total number of requests in a given time window.'
schema:
type: integer
components:
securitySchemes:
ApiKeyAuth:
type: apiKey

View File

@ -1,72 +1,75 @@
examples:
Client:
- id: Opnel5aKBz
user_id: Ua6Rw4pVbS
assigned_user_id: Ua6Rw4pVbS
company_id: Co7Vn3yLmW
name: "Jim's Housekeeping"
website: https://www.jims-housekeeping.com
private_notes: Client prefers email communication over phone calls
client_hash: asdfkjhk342hjhbfdvmnfb1
industry_id: 5
size_id: 2
address1: 123 Main St
address2: Apt 4B
city: Beverly Hills
state: California
postal_code: 90210
phone: 555-3434-3434
country_id: 1
custom_value1: Email
custom_value2: John Doe
custom_value3: Yes
custom_value4: $50,000
vat_number: VAT123456
id_number: ID123456
number: CL-0001
shipping_address1: 5 Wallaby Way
shipping_address2: Suite 5
shipping_city: Perth
shipping_state: Western Australia
shipping_postal_code: 6110
shipping_country_id: 4
is_deleted: false
balance: 500.00
paid_to_date: 2000.00
credit_balance: 100.00
last_login: 1628686031
created_at: 1617629031
updated_at: 1628445631
group_settings_id: Opnel5aKBz
routing_id: Opnel5aKBz3489-dfkiu-2239-sdsd
is_tax_exempt: false
has_valid_vat_number: false
payment_balance: 100
contacts:
- id: Opnel5aKBz
first_name: John
last_name: Doe
email: jim@gmail.com
phone: 555-3434-3434
send_invoice: true
custom_value1: Email
custom_value2: John Doe
custom_value3: Yes
custom_value4: $50,000
is_primary: true
created_at: 1617629031
updated_at: 1628445631
deleted_at: 1628445631
Meta:
value:
pagination:
total: 1
count: 1
per_page: 20
current_page: 1
total_pages: 1
links:
- first: https://invoicing.co/api/v1/invoices?page=1
- last: https://invoicing.co/api/v1/invoices?page=1
- prev: null
- next: null
#examples:
# Client:
# $ref: '#/components/schemas/Client'
# Client:
# id: Opnel5aKBz
# user_id: Ua6Rw4pVbS
# assigned_user_id: Ua6Rw4pVbS
# company_id: Co7Vn3yLmW
# name: "Jim's Housekeeping"
# website: https://www.jims-housekeeping.com
# private_notes: Client prefers email communication over phone calls
# client_hash: asdfkjhk342hjhbfdvmnfb1
# industry_id: 5
# size_id: 2
# address1: 123 Main St
# address2: Apt 4B
# city: Beverly Hills
# state: California
# postal_code: 90210
# phone: 555-3434-3434
# country_id: 1
# custom_value1: Email
# custom_value2: John Doe
# custom_value3: Yes
# custom_value4: $50,000
# vat_number: VAT123456
# id_number: ID123456
# number: CL-0001
# shipping_address1: 5 Wallaby Way
# shipping_address2: Suite 5
# shipping_city: Perth
# shipping_state: Western Australia
# shipping_postal_code: 6110
# shipping_country_id: 4
# is_deleted: false
# balance: 500.00
# paid_to_date: 2000.00
# credit_balance: 100.00
# last_login: 1628686031
# created_at: 1617629031
# updated_at: 1628445631
# group_settings_id: Opnel5aKBz
# routing_id: Opnel5aKBz3489-dfkiu-2239-sdsd
# is_tax_exempt: false
# has_valid_vat_number: false
# payment_balance: 100
# contacts:
# id: Opnel5aKBz
# first_name: John
# last_name: Doe
# email: jim@gmail.com
# phone: 555-3434-3434
# send_invoice: true
# custom_value1: Email
# custom_value2: John Doe
# custom_value3: Yes
# custom_value4: $50,000
# is_primary: true
# created_at: 1617629031
# updated_at: 1628445631
# deleted_at: 1628445631
# Meta:
# value:
# pagination:
# total: 1
# count: 1
# per_page: 20
# current_page: 1
# total_pages: 1
# links:
# - first: https://invoicing.co/api/v1/invoices?page=1
# - last: https://invoicing.co/api/v1/invoices?page=1
# - prev: null
# - next: null

View File

@ -139,7 +139,7 @@
description: The number of records to return for each request, default is 20
required: false
schema:
type: int
type: integer
example: 20
page_meta:
name: page
@ -147,7 +147,7 @@
description: The page number to return for this request (when performing pagination), default is 1
required: false
schema:
type: int
type: integer
example: 1
include:
name: include

View File

@ -45,7 +45,7 @@
Filters the entity list by entities that have been deleted.
required: false
schema:
type: booleans
type: boolean
example: ?is_deleted=true
vendor_id:
name: vendor_id

View File

@ -143,7 +143,7 @@
type: boolean
example: true
default_auto_bill:
type: enum
type: string
example: 'always'
description: |
A flag determining whether to auto-bill clients by default

View File

@ -7,11 +7,9 @@
settings:
description: 'Settings that are used for the frontend applications to store user preferences / metadata'
type: object
example: 'json object'
react_settings:
description: 'Dedicated settings object for the react web application'
type: object'
example: 'json object'
type: object
is_owner:
description: 'Determines whether the user owns this company'
type: boolean

View File

@ -101,7 +101,7 @@
type: number
format: float
example: '10.00'
readOnly:
readOnly: true
line_items:
type: array
description: 'An array of objects which define the line items of the invoice'

View File

@ -31,6 +31,6 @@
example: 1
readOnly: true
links:
type: array
type: object
description: 'The pagination links'
readOnly: true

View File

@ -10,99 +10,99 @@
type: string
description: 'The hashed ID of the user assigned to this product.'
example: pR0j3
required: false
project_id:
type: string
description: 'The hashed ID of the project that this product is associated with.'
example: pR0j3
required: false
vendor_id:
type: string
description: 'The hashed ID of the vendor that this product is associated with.'
example: pR0j3
required: false
custom_value1:
type: string
description: 'Custom value field 1.'
example: 'Custom value 1'
required: false
custom_value2:
type: string
description: 'Custom value field 2.'
example: 'Custom value 2'
required: false
custom_value3:
type: string
description: 'Custom value field 3.'
example: 'Custom value 3'
required: false
custom_value4:
type: string
description: 'Custom value field 4.'
example: 'Custom value 4'
required: false
product_key:
type: string
description: 'The product key.'
example: '1234'
required: false
notes:
type: string
description: 'Notes about the product.'
example: 'These are some notes about the product.'
required: false
cost:
type: number
format: double
description: 'The cost of the product.'
example: 10.0
required: false
price:
type: number
format: double
description: 'The price of the product.'
example: 20.0
required: false
quantity:
type: number
format: double
description: 'The quantity of the product.'
example: 5.0
required: false
default: 1
tax_name1:
type: string
description: 'The name of tax 1.'
example: 'Tax 1'
required: false
tax_rate1:
type: number
format: double
description: 'The rate of tax 1.'
example: 10.0
required: false
tax_name2:
type: string
description: 'The name of tax 2.'
example: 'Tax 2'
required: false
tax_rate2:
type: number
format: double
description: 'The rate of tax 2.'
example: 5.0
required: false
tax_name3:
type: string
description: 'The name of tax 3.'
example: 'Tax 3'
required: false
tax_rate3:
type: number
format: double
description: 'The rate of tax 3.'
example: 0.0
required: false
in_stock_quantity:
type: integer
format: int32
@ -114,32 +114,32 @@
The query parameter ?update_in_stock_quantity=true **MUST** be passed if you wish to update this value manually.
default: 0
required: false
stock_notification:
type: boolean
description: Indicates whether stock notifications are enabled for this product
default: true
required: false
stock_notification_threshold:
type: integer
format: int32
description: The minimum quantity threshold for which stock notifications will be triggered
default: 0
required: false
max_quantity:
type: integer
format: int32
description: The maximum quantity that can be ordered for this product
required: false
product_image:
type: string
description: The URL of the product image
format: uri-reference
required: false
tax_id:
type: string
default: '1'
required: false
description: |
The tax category id for this product.'

View File

@ -36,7 +36,6 @@ tags:
description: |
Endpoint definitions for interacting with vendors.
- name: Purchase Orders
summary: Purchase Orders
description: |
Endpoint definitions for interacting with purchase orders.
- name: expenses

View File

@ -91,8 +91,6 @@ paths:
summary: "Attempts authentication"
description: "Returns a CompanyUser object on success"
operationId: postLogin
security:
- []
parameters:
- $ref: "#/components/parameters/X-API-SECRET"
- $ref: "#/components/parameters/X-API-TOKEN"

View File

@ -125,12 +125,12 @@
items:
$ref: '#/components/schemas/Client'
example:
$ref: '#/components/examples/Client'
$ref: '#/components/schemas/Client'
meta:
type: object
$ref: '#/components/schemas/Meta'
example:
$ref: '#/components/examples/Meta'
$ref: '#/components/schemas/Meta'
401:
$ref: '#/components/responses/401'
403:

View File

@ -437,7 +437,6 @@
type: object
properties:
action:
required: true
type: string
description: |
The action to be performed, options include:
@ -470,7 +469,6 @@
- `send_email`
Emails an array of invoices. Requires additional properties to be sent. `email_type`
ids:
required: true
type: array
items:
description: "Array of hashed IDs to be bulk 'actioned - ['D2J234DFA','D2J234DFA','D2J234DFA']"