From 3285ba78f13430eea068f89085ba20ef16ee1fef Mon Sep 17 00:00:00 2001 From: Nipuna Ranasinghe Date: Thu, 16 Nov 2023 16:11:47 +0530 Subject: [PATCH 1/5] Update invoice related openAPI schemas --- openapi/ronin/openapi.yml | 80 +++++++++++++++++++++------------------ 1 file changed, 43 insertions(+), 37 deletions(-) diff --git a/openapi/ronin/openapi.yml b/openapi/ronin/openapi.yml index cf164e4f6..8c671f458 100644 --- a/openapi/ronin/openapi.yml +++ b/openapi/ronin/openapi.yml @@ -28,10 +28,10 @@ paths: description: "https://www.roninapp.com/api/clients" parameters: [] requestBody: - description: The data required to create a client. + description: The data required to create a client. content: application/json: - schema: + schema: $ref: '#/components/schemas/CreateClientRequest' tags: - "clients" @@ -40,7 +40,7 @@ paths: description: "Created client" content: application/json: - schema: + schema: $ref: '#/components/schemas/ClientObject' operationId: "create_client" get: @@ -72,7 +72,7 @@ paths: description: "An object with a property clients which is an array of Client objects." content: application/json: - schema: + schema: $ref: '#/components/schemas/Clients' operationId: "list_clients" /api/v2/clients/{id}.json: @@ -93,14 +93,14 @@ paths: description: "A client object" content: application/json: - schema: + schema: $ref: '#/components/schemas/ClientObject' operationId: "get_client" /api/v2/clients/{client_id}/contacts.json: post: summary: "Creates a new contact. Contacts represent individuals belonging to Clients. In many cases, if a Contact is a Client, the Contact is where the email and other important information for the client whereas the Client is just a shell container." description: "https://www.roninapp.com/api/contacts" - parameters: + parameters: - in: "path" name: "client_id" description: "The client ID" @@ -108,10 +108,10 @@ paths: type: string required: true requestBody: - description: The data required to create a contact. + description: The data required to create a contact. content: application/json: - schema: + schema: $ref: '#/components/schemas/CreateContactRequest' tags: - "contacts" @@ -120,7 +120,7 @@ paths: description: "Created contact" content: application/json: - schema: + schema: $ref: '#/components/schemas/Contact' operationId: "create_contact" get: @@ -152,7 +152,7 @@ paths: description: "An object with a property contacts which is an array of Contact objects." content: application/json: - schema: + schema: $ref: '#/components/schemas/Contacts' operationId: "list_contacts_by_client" /api/v2/contacts.json: @@ -179,7 +179,7 @@ paths: description: "An object with a property contacts which is an array of Contact objects." content: application/json: - schema: + schema: $ref: '#/components/schemas/Contacts' operationId: "list_contacts" /api/v2/contacts/{id}.json: @@ -200,7 +200,7 @@ paths: description: "A contact object" content: application/json: - schema: + schema: $ref: '#/components/schemas/Contact' operationId: "get_contact" /api/v2/estimates.json: @@ -209,10 +209,10 @@ paths: description: "https://www.roninapp.com/api/estimates" parameters: [] requestBody: - description: The data required to create an estimate. + description: The data required to create an estimate. content: application/json: - schema: + schema: $ref: '#/components/schemas/CreateEstimateRequest' tags: - "estimates" @@ -221,7 +221,7 @@ paths: description: "Created estimate" content: application/json: - schema: + schema: $ref: '#/components/schemas/Estimate' operationId: "create_estimate" get: @@ -241,7 +241,7 @@ paths: description: "An object with a property estimates which is an array of Estimate objects." content: application/json: - schema: + schema: $ref: '#/components/schemas/Estimates' operationId: "list_estimates" /api/v2/estimates/{id}.json: @@ -262,7 +262,7 @@ paths: description: "An estimate object" content: application/json: - schema: + schema: $ref: '#/components/schemas/Estimate' operationId: "get_estimate" /api/v2/invoices.json: @@ -271,10 +271,10 @@ paths: description: "https://www.roninapp.com/api/invoices" parameters: [] requestBody: - description: The data required to create an invoice. + description: The data required to create an invoice. content: application/json: - schema: + schema: $ref: '#/components/schemas/CreateInvoiceRequest' tags: - "invoices" @@ -283,7 +283,7 @@ paths: description: "Created invoice" content: application/json: - schema: + schema: $ref: '#/components/schemas/Invoice' operationId: "create_invoice" get: @@ -309,7 +309,7 @@ paths: description: "An object with a property invoices which is an array of Invoice objects." content: application/json: - schema: + schema: $ref: '#/components/schemas/Invoices' operationId: "list_invoices" /api/v2/invoices/{id}.json: @@ -330,7 +330,7 @@ paths: description: "An invoice object" content: application/json: - schema: + schema: $ref: '#/components/schemas/Invoice' operationId: "get_invoice" /api/v2/projects.json: @@ -339,10 +339,10 @@ paths: description: "https://www.roninapp.com/api/projects" parameters: [] requestBody: - description: The data required to create a project. + description: The data required to create a project. content: application/json: - schema: + schema: $ref: '#/components/schemas/CreateProjectRequest' tags: - "projects" @@ -351,7 +351,7 @@ paths: description: "Created project" content: application/json: - schema: + schema: $ref: '#/components/schemas/Project' operationId: "create_project" get: @@ -377,7 +377,7 @@ paths: description: "An object with a property projects which is an array of Project objects." content: application/json: - schema: + schema: $ref: '#/components/schemas/Projects' operationId: "list_projects" /api/v2/projects/{id}.json: @@ -398,7 +398,7 @@ paths: description: "An project object" content: application/json: - schema: + schema: $ref: '#/components/schemas/Projects' operationId: "get_project" /api/v2/task.json: @@ -407,10 +407,10 @@ paths: description: "https://www.roninapp.com/api/tasks" parameters: [] requestBody: - description: The data required to create a task. + description: The data required to create a task. content: application/json: - schema: + schema: $ref: '#/components/schemas/CreateTaskRequest' tags: - "tasks" @@ -419,7 +419,7 @@ paths: description: "Created task" content: application/json: - schema: + schema: $ref: '#/components/schemas/Task' operationId: "create_task" get: @@ -433,7 +433,7 @@ paths: description: "An object with a property tasks which is an array of Task objects." content: application/json: - schema: + schema: $ref: '#/components/schemas/Tasks' operationId: "list_tasks" /api/v2/tasks/{id}.json: @@ -454,13 +454,13 @@ paths: description: "An task object" content: application/json: - schema: + schema: $ref: '#/components/schemas/Task' operationId: "get_task" put: summary: "Updates a new task. Tasks are TODO items that can be added to projects and assigned to staff members." description: "https://www.roninapp.com/api/tasks" - parameters: + parameters: - in: "path" name: "id" description: "The task ID" @@ -468,10 +468,10 @@ paths: type: string required: true requestBody: - description: The data required to update a task. + description: The data required to update a task. content: application/json: - schema: + schema: $ref: '#/components/schemas/UpdateTaskRequest' tags: - "tasks" @@ -1027,6 +1027,7 @@ components: tax2_label: type: string description: Secondary tax label + nullable: true summary: type: string description: Summary @@ -1053,6 +1054,7 @@ components: tax3_label: type: string description: Tertiary tax label + nullable: true tax3: type: number description: Tertiary tax @@ -1066,6 +1068,10 @@ components: type: object properties: price: + oneOf: + - type: string + - type: number + format: float type: string description: Price title: @@ -1238,7 +1244,7 @@ components: budget: type: number description: Budget - description: Projects represent hubs of work, tasks, logged hours, expenses, and invoices related to a Client. budget_type can be 0 (total budgeted hours) or 1 (total budgeted amount). project_type can be 0 (hourly rate project) or 2 (fixed amount project). Rate the total cost of the project in the latter case. + description: Projects represent hubs of work, tasks, logged hours, expenses, and invoices related to a Client. budget_type can be 0 (total budgeted hours) or 1 (total budgeted amount). project_type can be 0 (hourly rate project) or 2 (fixed amount project). Rate the total cost of the project in the latter case. CreateTaskRequest: type: object properties: @@ -1350,7 +1356,7 @@ components: $ref: '#/components/schemas/Task' description: An array of Task objects. description: An object with a property tasks which is an array of Task objects. - + securitySchemes: basicAuth: From dfd007a674b99e1e34d1263255d3b69b55ea121f Mon Sep 17 00:00:00 2001 From: Nipuna Ranasinghe Date: Thu, 16 Nov 2023 16:15:04 +0530 Subject: [PATCH 2/5] Generate client --- openapi/ronin/types.bal | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/openapi/ronin/types.bal b/openapi/ronin/types.bal index 93decf4d8..e93a55ffc 100644 --- a/openapi/ronin/types.bal +++ b/openapi/ronin/types.bal @@ -203,7 +203,7 @@ public type Invoice record { # Invoice items InvoiceItem[] invoice_items?; # Secondary tax label - string tax2_label?; + string? tax2_label?; # Summary string summary?; # Total payments @@ -219,7 +219,7 @@ public type Invoice record { # Payments Payment[] payments?; # Tertiary tax label - string tax3_label?; + string? tax3_label?; # Tertiary tax decimal tax3?; # Invoice items attributes. invoice_item_attributes.title, invoice_item_attributes.quantity, invoice_item_attributes.price must be provided if any items are added. @@ -229,7 +229,7 @@ public type Invoice record { # Invoice item public type InvoiceItem record { # Price - string price?; + string|float price?; # Title string title?; # Quantity From 2f21db7341f3a55a26d745b23eed33144a8d33e9 Mon Sep 17 00:00:00 2001 From: Nipuna Ranasinghe Date: Thu, 16 Nov 2023 16:15:12 +0530 Subject: [PATCH 3/5] Update connector version --- openapi/ronin/Ballerina.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openapi/ronin/Ballerina.toml b/openapi/ronin/Ballerina.toml index b1367db01..2d409c8a2 100644 --- a/openapi/ronin/Ballerina.toml +++ b/openapi/ronin/Ballerina.toml @@ -6,5 +6,5 @@ name = "ronin" icon = "icon.png" distribution = "2201.4.1" repository = "https://github.com/ballerina-platform/openapi-connectors/tree/main/openapi/ronin" -version = "1.5.1" +version = "1.5.2" authors = ["Ballerina"] From 98e651b24402a7271dc5bca9e27fdfdb18667e29 Mon Sep 17 00:00:00 2001 From: Nipuna Ranasinghe Date: Fri, 17 Nov 2023 13:12:26 +0530 Subject: [PATCH 4/5] Fix data-binding issues in getClient API --- openapi/ronin/openapi.yml | 4 ++++ openapi/ronin/types.bal | 8 ++++---- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/openapi/ronin/openapi.yml b/openapi/ronin/openapi.yml index 8c671f458..5a81e10c0 100644 --- a/openapi/ronin/openapi.yml +++ b/openapi/ronin/openapi.yml @@ -530,6 +530,7 @@ components: number: type: string description: The unique number for the client + nullable: true name: type: string description: The name of the client @@ -551,12 +552,15 @@ components: website: type: string description: The website of the client + nullable: true address_2: type: string description: The address2 of the client + nullable: true description: type: string description: The description about the client + nullable: true state: type: string description: The state of the client diff --git a/openapi/ronin/types.bal b/openapi/ronin/types.bal index e93a55ffc..14ad0488b 100644 --- a/openapi/ronin/types.bal +++ b/openapi/ronin/types.bal @@ -345,7 +345,7 @@ public type UpdateTaskRequest record { # Clients represent companies, groups, organizations or other contact containers. All contacts must belong to a client. Clients are also the main containers for Projects and Invoices. public type ClientObject record { # The unique number for the client - string number?; + string? number?; # The name of the client string name?; # The city of the client @@ -359,11 +359,11 @@ public type ClientObject record { # Client ID int id?; # The website of the client - string website?; + string? website?; # The address2 of the client - string address_2?; + string? address_2?; # The description about the client - string description?; + string? description?; # The state of the client string state?; }; From dd38f0291e597fff5770f0ac024d8163f495f2ca Mon Sep 17 00:00:00 2001 From: Nipuna Ranasinghe Date: Fri, 17 Nov 2023 13:44:58 +0530 Subject: [PATCH 5/5] Add a minor fix --- openapi/ronin/openapi.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/openapi/ronin/openapi.yml b/openapi/ronin/openapi.yml index 5a81e10c0..6b641a82a 100644 --- a/openapi/ronin/openapi.yml +++ b/openapi/ronin/openapi.yml @@ -1076,7 +1076,6 @@ components: - type: string - type: number format: float - type: string description: Price title: type: string