From 549c5a599f7f17e0b9b0d7af574f721e27b6d9fa Mon Sep 17 00:00:00 2001 From: George J Padayatti Date: Thu, 12 Oct 2023 20:55:11 +0530 Subject: [PATCH] Upd: Use object in the response Signed-off-by: George J Padayatti --- openapi/v2023.8.2/bundled.yaml | 105 ++++++++++++------ openapi/v2023.8.2/definitions/Pagination.yaml | 21 ++++ openapi/v2023.8.2/index.yaml | 52 +++++---- openapi/v2023.8.2/parameters/limit.yaml | 2 +- openapi/v2023.8.2/parameters/offset.yaml | 6 + .../v2023.8.2/paths/configCreatePolicy.yaml | 11 +- openapi/v2023.8.2/paths/configListPolicy.yaml | 51 ++++----- .../paths/configListPolicyRevisions.yaml | 52 +++++---- openapi/v2023.8.2/paths/configReadPolicy.yaml | 11 +- .../v2023.8.2/paths/configUpdatePolicy.yaml | 11 +- 10 files changed, 193 insertions(+), 129 deletions(-) create mode 100644 openapi/v2023.8.2/definitions/Pagination.yaml create mode 100644 openapi/v2023.8.2/parameters/offset.yaml diff --git a/openapi/v2023.8.2/bundled.yaml b/openapi/v2023.8.2/bundled.yaml index 44de055..352dd35 100644 --- a/openapi/v2023.8.2/bundled.yaml +++ b/openapi/v2023.8.2/bundled.yaml @@ -1,5 +1,27 @@ components: schemas: + Pagination: + type: object + title: Pagination + properties: + currentPage: + type: integer + description: Current page number + totalItems: + type: integer + description: Total number of items available + totalPages: + type: integer + description: Total number of pages based on limit + limit: + type: integer + description: Number of items per page + hasPrevious: + type: boolean + description: Indicates if there's a previous page + hasNext: + type: boolean + description: Indicates if there's a next page Agreement: type: object title: Agreement @@ -1069,21 +1091,33 @@ paths: required: false schema: type: integer - - description: Requested number of resources to be provided in response requested by client + - name: limit in: query - name: limit + description: Number of items returned per page. Requested number of resources to be provided in response requested by client + required: false + schema: + type: integer + default: 10 + - name: page + in: query + description: Page number required: false schema: type: integer + default: 1 responses: '200': content: application/json: schema: - items: - oneOf: - - $ref: '#/components/schemas/Policy' - type: array + type: object + properties: + policies: + items: + $ref: '#/components/schemas/Policy' + type: array + pagination: + $ref: '#/components/schemas/Pagination' description: A list of Policy objects readable for the current session's credentials. '400': description: bad input parameter @@ -1117,11 +1151,12 @@ paths: content: application/json: schema: - items: - oneOf: - - $ref: '#/components/schemas/Policy' - - $ref: '#/components/schemas/Revision' - type: array + type: object + properties: + policy: + $ref: '#/components/schemas/Policy' + revision: + $ref: '#/components/schemas/Revision' description: 'A set consisting of the new Policy object created, together with the initial Revision object.' '400': description: bad input parameter @@ -1184,11 +1219,12 @@ paths: content: application/json: schema: - items: - oneOf: - - $ref: '#/components/schemas/Policy' - - $ref: '#/components/schemas/Revision' - type: array + type: object + properties: + policy: + $ref: '#/components/schemas/Policy' + revision: + $ref: '#/components/schemas/Revision' description: '' '400': description: bad input parameter @@ -1227,11 +1263,12 @@ paths: content: application/json: schema: - items: - oneOf: - - $ref: '#/components/schemas/Policy' - - $ref: '#/components/schemas/Revision' - type: array + type: object + properties: + policy: + $ref: '#/components/schemas/Policy' + revision: + $ref: '#/components/schemas/Revision' description: '' '400': description: bad input parameter @@ -1255,24 +1292,24 @@ paths: required: true schema: type: string - - description: Requested index for start of resources to be provided in response requested by client - in: query - name: offset - required: false - schema: - type: integer - - description: Requested number of resources to be provided in response requested by client - in: query - name: limit - required: false - schema: - type: integer + - $ref: '#/paths/~1config~1policies/get/parameters/1' + - $ref: '#/paths/~1config~1policies/get/parameters/2' + - $ref: '#/paths/~1config~1policies/get/parameters/3' responses: '200': content: application/json: schema: - $ref: '#/components/schemas/Policy' + type: object + properties: + policy: + $ref: '#/components/schemas/Policy' + revisions: + type: array + items: + $ref: '#/components/schemas/Revision' + pagination: + $ref: '#/components/schemas/Pagination' description: '' '400': description: bad input parameter diff --git a/openapi/v2023.8.2/definitions/Pagination.yaml b/openapi/v2023.8.2/definitions/Pagination.yaml new file mode 100644 index 0000000..5c01c9c --- /dev/null +++ b/openapi/v2023.8.2/definitions/Pagination.yaml @@ -0,0 +1,21 @@ +type: object +title: Pagination +properties: + currentPage: + type: integer + description: Current page number + totalItems: + type: integer + description: Total number of items available + totalPages: + type: integer + description: Total number of pages based on limit + limit: + type: integer + description: Number of items per page + hasPrevious: + type: boolean + description: Indicates if there's a previous page + hasNext: + type: boolean + description: Indicates if there's a next page \ No newline at end of file diff --git a/openapi/v2023.8.2/index.yaml b/openapi/v2023.8.2/index.yaml index 8863550..5bcf565 100644 --- a/openapi/v2023.8.2/index.yaml +++ b/openapi/v2023.8.2/index.yaml @@ -1,5 +1,7 @@ components: schemas: + Pagination: + $ref: "./definitions/Pagination.yaml" Agreement: $ref: ./definitions/Agreement.yaml AgreementData: @@ -45,7 +47,8 @@ info: email: support@igrant.io name: iGrant.io url: https://igrant.io - description: The Consent Building Block enables services for individuals to approve + description: + The Consent Building Block enables services for individuals to approve the use of their personal data by defining the principles, functions, and architecture of an information system. For organisations that process personal data, it provides the ability to know the individual's will and legitimately process such personal @@ -196,26 +199,29 @@ paths: post: $ref: ./paths/serviceVerificationAgreementListFilter.yaml servers: -- description: Development server - url: https://api.bb-consent.dev/v2 -- description: Staging server - url: https://staging-consent-bb-api.igrant.io/v2 -- description: Demo server - url: https://demo-consent-bb-api.igrant.io/v2 + - description: Development server + url: https://api.bb-consent.dev/v2 + - description: Staging server + url: https://staging-consent-bb-api.igrant.io/v2 + - description: Demo server + url: https://demo-consent-bb-api.igrant.io/v2 tags: -- description: Operations for external auditing systems to query detailed data from - the system and subscribe to notifications. - name: audit - x-tag-expanded: false -- description: Secured operations available to organization API integration - name: config - x-tag-expanded: false -- description: Secured operations for individuals, data consumers and applications - to record and verify consent - name: service - x-tag-expanded: false -- description: These are used for onboard the organisation, organisation admin and - individual users to the system. It also deals with all authentication and authorisation - APIs that can be configured towards external IDPs. - name: onboard - x-tag-expanded: false + - description: + Operations for external auditing systems to query detailed data from + the system and subscribe to notifications. + name: audit + x-tag-expanded: false + - description: Secured operations available to organization API integration + name: config + x-tag-expanded: false + - description: + Secured operations for individuals, data consumers and applications + to record and verify consent + name: service + x-tag-expanded: false + - description: + These are used for onboard the organisation, organisation admin and + individual users to the system. It also deals with all authentication and authorisation + APIs that can be configured towards external IDPs. + name: onboard + x-tag-expanded: false diff --git a/openapi/v2023.8.2/parameters/limit.yaml b/openapi/v2023.8.2/parameters/limit.yaml index 647ab9e..537f9a0 100644 --- a/openapi/v2023.8.2/parameters/limit.yaml +++ b/openapi/v2023.8.2/parameters/limit.yaml @@ -1,6 +1,6 @@ name: limit in: query -description: Number of items to return per page +description: Number of items returned per page. Requested number of resources to be provided in response requested by client required: false schema: type: integer diff --git a/openapi/v2023.8.2/parameters/offset.yaml b/openapi/v2023.8.2/parameters/offset.yaml new file mode 100644 index 0000000..930f7c0 --- /dev/null +++ b/openapi/v2023.8.2/parameters/offset.yaml @@ -0,0 +1,6 @@ +description: Requested index for start of resources to be provided in response requested by client +in: query +name: offset +required: false +schema: + type: integer \ No newline at end of file diff --git a/openapi/v2023.8.2/paths/configCreatePolicy.yaml b/openapi/v2023.8.2/paths/configCreatePolicy.yaml index 6710c50..fd6ca29 100644 --- a/openapi/v2023.8.2/paths/configCreatePolicy.yaml +++ b/openapi/v2023.8.2/paths/configCreatePolicy.yaml @@ -17,11 +17,12 @@ responses: content: application/json: schema: - items: - oneOf: - - $ref: ../definitions/Policy.yaml - - $ref: ../definitions/Revision.yaml - type: array + type: object + properties: + policy: + $ref: ../definitions/Policy.yaml + revision: + $ref: ../definitions/Revision.yaml description: A set consisting of the new Policy object created, together with the initial Revision object. '400': diff --git a/openapi/v2023.8.2/paths/configListPolicy.yaml b/openapi/v2023.8.2/paths/configListPolicy.yaml index 54f5eba..4b76a17 100644 --- a/openapi/v2023.8.2/paths/configListPolicy.yaml +++ b/openapi/v2023.8.2/paths/configListPolicy.yaml @@ -1,44 +1,37 @@ description: LIST - Fetch all policies operationId: configListPolicy parameters: -- description: An object with id revisionId - in: query - name: revisionId - required: false - schema: - type: string -- description: Requested index for start of resources to be provided in response requested - by client - in: query - name: offset - required: false - schema: - type: integer -- description: Requested number of resources to be provided in response requested - by client - in: query - name: limit - required: false - schema: - type: integer + - description: An object with id revisionId + in: query + name: revisionId + required: false + schema: + type: string + - $ref: "../parameters/offset.yaml" + - $ref: "../parameters/limit.yaml" + - $ref: "../parameters/page.yaml" responses: - '200': + "200": content: application/json: schema: - items: - oneOf: - - $ref: ../definitions/Policy.yaml - type: array + type: object + properties: + policies: + items: + $ref: ../definitions/Policy.yaml + type: array + pagination: + $ref: "../definitions/Pagination.yaml" description: A list of Policy objects readable for the current session's credentials. - '400': + "400": description: bad input parameter security: - BearerAuth: [] summary: LIST - Fetch all policies tags: -- config + - config x-specification-crudl-model: Policy -x-specification-pii-or-sensitive: 'False' -x-specification-scenario: '' +x-specification-pii-or-sensitive: "False" +x-specification-scenario: "" x-specification-usecase: UC-C-PIC-A-001, UC-C-PIC-A-002 diff --git a/openapi/v2023.8.2/paths/configListPolicyRevisions.yaml b/openapi/v2023.8.2/paths/configListPolicyRevisions.yaml index 1d1b256..d13dfdb 100644 --- a/openapi/v2023.8.2/paths/configListPolicyRevisions.yaml +++ b/openapi/v2023.8.2/paths/configListPolicyRevisions.yaml @@ -1,41 +1,39 @@ description: LIST - Returns all the revisions for the policy operationId: configListPolicyRevisions parameters: -- description: Unique ID of an object - in: path - name: policyId - required: true - schema: - type: string -- description: Requested index for start of resources to be provided in response requested - by client - in: query - name: offset - required: false - schema: - type: integer -- description: Requested number of resources to be provided in response requested - by client - in: query - name: limit - required: false - schema: - type: integer + - description: Unique ID of an object + in: path + name: policyId + required: true + schema: + type: string + - $ref: "../parameters/offset.yaml" + - $ref: "../parameters/limit.yaml" + - $ref: "../parameters/page.yaml" responses: - '200': + "200": content: application/json: schema: - $ref: ../definitions/Policy.yaml - description: '' - '400': + type: object + properties: + policy: + $ref: ../definitions/Policy.yaml + revisions: + type: array + items: + $ref: ../definitions/Revision.yaml + pagination: + $ref: "../definitions/Pagination.yaml" + description: "" + "400": description: bad input parameter security: - BearerAuth: [] summary: LIST - Returns all the revisions for the policy tags: -- config + - config x-specification-crudl-model: Revision -x-specification-pii-or-sensitive: 'False' -x-specification-scenario: '' +x-specification-pii-or-sensitive: "False" +x-specification-scenario: "" x-specification-usecase: UC-C-PIC-A-003 diff --git a/openapi/v2023.8.2/paths/configReadPolicy.yaml b/openapi/v2023.8.2/paths/configReadPolicy.yaml index 6c9bedf..a0597e2 100644 --- a/openapi/v2023.8.2/paths/configReadPolicy.yaml +++ b/openapi/v2023.8.2/paths/configReadPolicy.yaml @@ -19,11 +19,12 @@ responses: content: application/json: schema: - items: - oneOf: - - $ref: ../definitions/Policy.yaml - - $ref: ../definitions/Revision.yaml - type: array + type: object + properties: + policy: + $ref: ../definitions/Policy.yaml + revision: + $ref: ../definitions/Revision.yaml description: '' '400': description: bad input parameter diff --git a/openapi/v2023.8.2/paths/configUpdatePolicy.yaml b/openapi/v2023.8.2/paths/configUpdatePolicy.yaml index c3e6f92..a7e12fc 100644 --- a/openapi/v2023.8.2/paths/configUpdatePolicy.yaml +++ b/openapi/v2023.8.2/paths/configUpdatePolicy.yaml @@ -25,11 +25,12 @@ responses: content: application/json: schema: - items: - oneOf: - - $ref: ../definitions/Policy.yaml - - $ref: ../definitions/Revision.yaml - type: array + type: object + properties: + policy: + $ref: ../definitions/Policy.yaml + revision: + $ref: ../definitions/Revision.yaml description: "" "400": description: bad input parameter