From 10a172a5c94cbcf93d757b8fe6afb86965c0ac6c Mon Sep 17 00:00:00 2001 From: Siva Date: Mon, 9 Dec 2024 09:46:04 +0000 Subject: [PATCH] Auto generate API docs --- reference/admin.yaml | 83 ++++++++++++++--------------------------- reference/approver.yaml | 83 ++++++++++++++--------------------------- reference/spender.yaml | 83 ++++++++++++++--------------------------- 3 files changed, 87 insertions(+), 162 deletions(-) diff --git a/reference/admin.yaml b/reference/admin.yaml index cfbfa4d88..7f982b50e 100644 --- a/reference/admin.yaml +++ b/reference/admin.yaml @@ -6209,9 +6209,6 @@ components: id: $ref: '#/components/schemas/id_string' reports_stats_in: - type: object - required: - - data properties: query_params: type: string @@ -6239,12 +6236,12 @@ components: count: type: integer nullable: false - description: Number of matching reports in this state + description: Number of matching reports in this state. example: 5 total_amount: type: number nullable: false - description: Sum of amounts for matching reports in this state + description: Sum of amounts for matching reports in this state. example: 2200 state: type: string @@ -6256,70 +6253,72 @@ components: - APPROVED - PAYMENT_PENDING - PAID - description: Report state + description: Report state. failed_amount: type: number nullable: true - description: Sum of reimbursable amount for ACH-failed reports, applicable only in PAYMENT_PROCESSING state + description: Sum of reimbursable amount for ACH-failed reports, applicable only in PAYMENT_PROCESSING state. example: 200 failed_count: type: integer nullable: true - description: Count of ACH-failed reports, applicable only in PAYMENT_PROCESSING state + description: Count of ACH-failed reports, applicable only in PAYMENT_PROCESSING state. example: 1 processing_amount: type: number nullable: true - description: Sum of reimbursable amount for processing reports, applicable only in PAYMENT_PROCESSING state + description: Sum of reimbursable amount for processing reports, applicable only in PAYMENT_PROCESSING state. example: 1500 processing_count: type: integer nullable: true - description: Count of processing reports, applicable only in PAYMENT_PROCESSING state + description: Count of processing reports, applicable only in PAYMENT_PROCESSING state. example: 3 reimbursable_amount: type: number nullable: false - description: Sum of reimbursable amounts for matching reports in this state + description: Sum of reimbursable amounts for matching reports in this state. example: 500 - type: object + title: Overall stats + description: Overall stats without state grouping (response for older mobile app versions). + required: + - count + - total_amount + - processing_amount + - processing_count + - failed_amount + - failed_count properties: count: type: integer nullable: false - description: | - This field indicates the count of reports. + description: Total number of matching reports. example: 1 total_amount: - allOf: - - $ref: '#/components/schemas/amount' - description: | - This field indicates the sum of amount of reports. + type: number + nullable: false + description: Total sum of amounts for all matching reports. example: 100 processing_amount: - allOf: - - $ref: '#/components/schemas/amount' - description: | - This field indicates the sum of reimbursable amount of reports in Processing state. + type: number + nullable: true + description: Sum of reimbursable amounts for reports in processing state. example: 101 processing_count: type: integer - description: | - This field indicates the count of reports in Processing state. + nullable: true + description: Count of reports in processing state. example: 2 failed_amount: + type: number nullable: true - anyOf: - - $ref: '#/components/schemas/amount' - - $ref: '#/components/schemas/null_field' - description: | - This field indicates the sum of reimbursable amount of reports in Processing state for which ACH has failed + description: Sum of reimbursable amounts for reports in processing state with ACH failures. example: 101 failed_count: type: integer nullable: true - description: | - This field indicates the count of reports in processing state for which ACH has failed. + description: Count of reports in processing state with ACH failures. example: 1 example: - state: DRAFT @@ -6338,14 +6337,6 @@ components: processing_count: null reimbursable_amount: 500 total_amount: 2200 - - state: APPROVER_INQUIRY - count: 2 - failed_amount: null - failed_count: null - processing_amount: null - processing_count: null - reimbursable_amount: 0 - total_amount: 500 - state: PAYMENT_PROCESSING count: 5 failed_amount: 200 @@ -6354,22 +6345,6 @@ components: processing_count: 3 reimbursable_amount: 500 total_amount: 2200 - - state: APPROVED - count: 0 - failed_amount: null - failed_count: null - processing_amount: null - processing_count: null - reimbursable_amount: 0 - total_amount: 0 - - state: PAYMENT_PENDING - count: 0 - failed_amount: null - failed_count: null - processing_amount: null - processing_count: null - reimbursable_amount: 0 - total_amount: 0 - state: PAID count: 0 failed_amount: null diff --git a/reference/approver.yaml b/reference/approver.yaml index 94c6698b8..158ee04e7 100644 --- a/reference/approver.yaml +++ b/reference/approver.yaml @@ -2714,9 +2714,6 @@ components: - $ref: '#/components/schemas/id_string' example: rpfilumWHrlPf7K reports_stats_in: - type: object - required: - - data properties: query_params: type: string @@ -2744,12 +2741,12 @@ components: count: type: integer nullable: false - description: Number of matching reports in this state + description: Number of matching reports in this state. example: 5 total_amount: type: number nullable: false - description: Sum of amounts for matching reports in this state + description: Sum of amounts for matching reports in this state. example: 2200 state: type: string @@ -2761,70 +2758,72 @@ components: - APPROVED - PAYMENT_PENDING - PAID - description: Report state + description: Report state. failed_amount: type: number nullable: true - description: Sum of reimbursable amount for ACH-failed reports, applicable only in PAYMENT_PROCESSING state + description: Sum of reimbursable amount for ACH-failed reports, applicable only in PAYMENT_PROCESSING state. example: 200 failed_count: type: integer nullable: true - description: Count of ACH-failed reports, applicable only in PAYMENT_PROCESSING state + description: Count of ACH-failed reports, applicable only in PAYMENT_PROCESSING state. example: 1 processing_amount: type: number nullable: true - description: Sum of reimbursable amount for processing reports, applicable only in PAYMENT_PROCESSING state + description: Sum of reimbursable amount for processing reports, applicable only in PAYMENT_PROCESSING state. example: 1500 processing_count: type: integer nullable: true - description: Count of processing reports, applicable only in PAYMENT_PROCESSING state + description: Count of processing reports, applicable only in PAYMENT_PROCESSING state. example: 3 reimbursable_amount: type: number nullable: false - description: Sum of reimbursable amounts for matching reports in this state + description: Sum of reimbursable amounts for matching reports in this state. example: 500 - type: object + title: Overall stats + description: Overall stats without state grouping (response for older mobile app versions). + required: + - count + - total_amount + - processing_amount + - processing_count + - failed_amount + - failed_count properties: count: type: integer nullable: false - description: | - This field indicates the count of reports. + description: Total number of matching reports. example: 1 total_amount: - allOf: - - $ref: '#/components/schemas/amount' - description: | - This field indicates the sum of amount of reports. + type: number + nullable: false + description: Total sum of amounts for all matching reports. example: 100 processing_amount: - allOf: - - $ref: '#/components/schemas/amount' - description: | - This field indicates the sum of reimbursable amount of reports in Processing state. + type: number + nullable: true + description: Sum of reimbursable amounts for reports in processing state. example: 101 processing_count: type: integer - description: | - This field indicates the count of reports in Processing state. + nullable: true + description: Count of reports in processing state. example: 2 failed_amount: + type: number nullable: true - anyOf: - - $ref: '#/components/schemas/amount' - - $ref: '#/components/schemas/null_field' - description: | - This field indicates the sum of reimbursable amount of reports in Processing state for which ACH has failed + description: Sum of reimbursable amounts for reports in processing state with ACH failures. example: 101 failed_count: type: integer nullable: true - description: | - This field indicates the count of reports in processing state for which ACH has failed. + description: Count of reports in processing state with ACH failures. example: 1 example: - state: DRAFT @@ -2843,14 +2842,6 @@ components: processing_count: null reimbursable_amount: 500 total_amount: 2200 - - state: APPROVER_INQUIRY - count: 2 - failed_amount: null - failed_count: null - processing_amount: null - processing_count: null - reimbursable_amount: 0 - total_amount: 500 - state: PAYMENT_PROCESSING count: 5 failed_amount: 200 @@ -2859,22 +2850,6 @@ components: processing_count: 3 reimbursable_amount: 500 total_amount: 2200 - - state: APPROVED - count: 0 - failed_amount: null - failed_count: null - processing_amount: null - processing_count: null - reimbursable_amount: 0 - total_amount: 0 - - state: PAYMENT_PENDING - count: 0 - failed_amount: null - failed_count: null - processing_amount: null - processing_count: null - reimbursable_amount: 0 - total_amount: 0 - state: PAID count: 0 failed_amount: null diff --git a/reference/spender.yaml b/reference/spender.yaml index a8d11bd35..9c2fcbe96 100644 --- a/reference/spender.yaml +++ b/reference/spender.yaml @@ -3250,9 +3250,6 @@ components: id of report, which needs to be resubmitted example: rpa21A2rdj2 reports_stats_in: - type: object - required: - - data properties: query_params: type: string @@ -3280,12 +3277,12 @@ components: count: type: integer nullable: false - description: Number of matching reports in this state + description: Number of matching reports in this state. example: 5 total_amount: type: number nullable: false - description: Sum of amounts for matching reports in this state + description: Sum of amounts for matching reports in this state. example: 2200 state: type: string @@ -3297,70 +3294,72 @@ components: - APPROVED - PAYMENT_PENDING - PAID - description: Report state + description: Report state. failed_amount: type: number nullable: true - description: Sum of reimbursable amount for ACH-failed reports, applicable only in PAYMENT_PROCESSING state + description: Sum of reimbursable amount for ACH-failed reports, applicable only in PAYMENT_PROCESSING state. example: 200 failed_count: type: integer nullable: true - description: Count of ACH-failed reports, applicable only in PAYMENT_PROCESSING state + description: Count of ACH-failed reports, applicable only in PAYMENT_PROCESSING state. example: 1 processing_amount: type: number nullable: true - description: Sum of reimbursable amount for processing reports, applicable only in PAYMENT_PROCESSING state + description: Sum of reimbursable amount for processing reports, applicable only in PAYMENT_PROCESSING state. example: 1500 processing_count: type: integer nullable: true - description: Count of processing reports, applicable only in PAYMENT_PROCESSING state + description: Count of processing reports, applicable only in PAYMENT_PROCESSING state. example: 3 reimbursable_amount: type: number nullable: false - description: Sum of reimbursable amounts for matching reports in this state + description: Sum of reimbursable amounts for matching reports in this state. example: 500 - type: object + title: Overall stats + description: Overall stats without state grouping (response for older mobile app versions). + required: + - count + - total_amount + - processing_amount + - processing_count + - failed_amount + - failed_count properties: count: type: integer nullable: false - description: | - This field indicates the count of reports. + description: Total number of matching reports. example: 1 total_amount: - allOf: - - $ref: '#/components/schemas/amount' - description: | - This field indicates the sum of amount of reports. + type: number + nullable: false + description: Total sum of amounts for all matching reports. example: 100 processing_amount: - allOf: - - $ref: '#/components/schemas/amount' - description: | - This field indicates the sum of reimbursable amount of reports in Processing state. + type: number + nullable: true + description: Sum of reimbursable amounts for reports in processing state. example: 101 processing_count: type: integer - description: | - This field indicates the count of reports in Processing state. + nullable: true + description: Count of reports in processing state. example: 2 failed_amount: + type: number nullable: true - anyOf: - - $ref: '#/components/schemas/amount' - - $ref: '#/components/schemas/null_field' - description: | - This field indicates the sum of reimbursable amount of reports in Processing state for which ACH has failed + description: Sum of reimbursable amounts for reports in processing state with ACH failures. example: 101 failed_count: type: integer nullable: true - description: | - This field indicates the count of reports in processing state for which ACH has failed. + description: Count of reports in processing state with ACH failures. example: 1 example: - state: DRAFT @@ -3379,14 +3378,6 @@ components: processing_count: null reimbursable_amount: 500 total_amount: 2200 - - state: APPROVER_INQUIRY - count: 2 - failed_amount: null - failed_count: null - processing_amount: null - processing_count: null - reimbursable_amount: 0 - total_amount: 500 - state: PAYMENT_PROCESSING count: 5 failed_amount: 200 @@ -3395,22 +3386,6 @@ components: processing_count: 3 reimbursable_amount: 500 total_amount: 2200 - - state: APPROVED - count: 0 - failed_amount: null - failed_count: null - processing_amount: null - processing_count: null - reimbursable_amount: 0 - total_amount: 0 - - state: PAYMENT_PENDING - count: 0 - failed_amount: null - failed_count: null - processing_amount: null - processing_count: null - reimbursable_amount: 0 - total_amount: 0 - state: PAID count: 0 failed_amount: null