From 5dfa240255a2f03b3157b43bc664d8113985a060 Mon Sep 17 00:00:00 2001 From: Elliana May Date: Thu, 26 Aug 2021 14:15:27 +0800 Subject: [PATCH 1/4] Declare request body for POST /api/v1/invoices Related to https://github.com/invoiceninja/invoiceninja/issues/5473 --- app/Http/Controllers/InvoiceController.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/Http/Controllers/InvoiceController.php b/app/Http/Controllers/InvoiceController.php index 1e831d4bae8c..00e1e8cfd0da 100644 --- a/app/Http/Controllers/InvoiceController.php +++ b/app/Http/Controllers/InvoiceController.php @@ -185,6 +185,10 @@ class InvoiceController extends BaseController * @OA\Parameter(ref="#/components/parameters/X-Api-Token"), * @OA\Parameter(ref="#/components/parameters/X-Requested-With"), * @OA\Parameter(ref="#/components/parameters/include"), + * @OA\RequestBody( + * required=true, + * @OA\JsonContent(ref="#/components/schemas/Invoice") + * ), * @OA\Response( * response=200, * description="Returns the saved invoice object", From 9df00d68c0a9c07d4316ba3456c47f76da9e6230 Mon Sep 17 00:00:00 2001 From: Elliana May Date: Mon, 18 Oct 2021 12:16:29 +0800 Subject: [PATCH 2/4] Create FillableInvoiceSchema.php --- .../OpenAPI/FillableInvoiceSchema.php | 38 +++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 app/Http/Controllers/OpenAPI/FillableInvoiceSchema.php diff --git a/app/Http/Controllers/OpenAPI/FillableInvoiceSchema.php b/app/Http/Controllers/OpenAPI/FillableInvoiceSchema.php new file mode 100644 index 000000000000..bb923e72921b --- /dev/null +++ b/app/Http/Controllers/OpenAPI/FillableInvoiceSchema.php @@ -0,0 +1,38 @@ + + Date: Mon, 18 Oct 2021 12:17:07 +0800 Subject: [PATCH 3/4] Update $ref to FillableInvoice --- app/Http/Controllers/InvoiceController.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Http/Controllers/InvoiceController.php b/app/Http/Controllers/InvoiceController.php index 00e1e8cfd0da..0dafd4632780 100644 --- a/app/Http/Controllers/InvoiceController.php +++ b/app/Http/Controllers/InvoiceController.php @@ -187,7 +187,7 @@ class InvoiceController extends BaseController * @OA\Parameter(ref="#/components/parameters/include"), * @OA\RequestBody( * required=true, - * @OA\JsonContent(ref="#/components/schemas/Invoice") + * @OA\JsonContent(ref="#/components/schemas/FillableInvoice") * ), * @OA\Response( * response=200, From daa5bdb2b770dd155f892572145916a6853b2bf5 Mon Sep 17 00:00:00 2001 From: Elliana May Date: Mon, 18 Oct 2021 12:17:38 +0800 Subject: [PATCH 4/4] Remove newline --- app/Http/Controllers/OpenAPI/FillableInvoiceSchema.php | 1 - 1 file changed, 1 deletion(-) diff --git a/app/Http/Controllers/OpenAPI/FillableInvoiceSchema.php b/app/Http/Controllers/OpenAPI/FillableInvoiceSchema.php index bb923e72921b..3eb4d66027e5 100644 --- a/app/Http/Controllers/OpenAPI/FillableInvoiceSchema.php +++ b/app/Http/Controllers/OpenAPI/FillableInvoiceSchema.php @@ -1,4 +1,3 @@ -