From 3f9edbbb4b87b0c3d714d120cc9576a1060210aa Mon Sep 17 00:00:00 2001 From: Oriol Lopez-Doriga Date: Tue, 11 Jun 2024 15:38:19 +0200 Subject: [PATCH] adding boolean and count resultSets to yaml --- .../src/responses/beaconBooleanResponse.yaml | 6 ++- .../src/responses/beaconCountResponse.yaml | 5 ++ .../sections/beaconBooleanResponse.yaml | 33 +++++++++++++ .../sections/beaconBooleanResultsets.yaml | 43 +++++++++++++++++ .../sections/beaconCountResultsets.yaml | 47 +++++++++++++++++++ 5 files changed, 133 insertions(+), 1 deletion(-) create mode 100644 framework/src/responses/sections/beaconBooleanResponse.yaml create mode 100644 framework/src/responses/sections/beaconBooleanResultsets.yaml create mode 100644 framework/src/responses/sections/beaconCountResultsets.yaml diff --git a/framework/src/responses/beaconBooleanResponse.yaml b/framework/src/responses/beaconBooleanResponse.yaml index 976a03628..7adb10306 100644 --- a/framework/src/responses/beaconBooleanResponse.yaml +++ b/framework/src/responses/beaconBooleanResponse.yaml @@ -22,8 +22,12 @@ properties: description: >- List of handovers that apply to the whole response, not to any resultset or result in particular. - $ref: ../common/beaconCommonComponents.yaml#/definitions/ListOfHandovers + response: + description: >- + Response for queries that recovers any result. + $ref: ./sections/beaconBooleanResultsets.yaml required: - meta - responseSummary + - response diff --git a/framework/src/responses/beaconCountResponse.yaml b/framework/src/responses/beaconCountResponse.yaml index 7b9d11570..0356e33bc 100644 --- a/framework/src/responses/beaconCountResponse.yaml +++ b/framework/src/responses/beaconCountResponse.yaml @@ -23,6 +23,11 @@ properties: List of handovers that apply to the whole response, not to any resultset or result in particular. $ref: ../common/beaconCommonComponents.yaml#/definitions/ListOfHandovers + response: + description: >- + Response for queries that recovers any result. + $ref: ./sections/beaconBooleanResultsets.yaml required: - meta - responseSummary + - response diff --git a/framework/src/responses/sections/beaconBooleanResponse.yaml b/framework/src/responses/sections/beaconBooleanResponse.yaml new file mode 100644 index 000000000..7adb10306 --- /dev/null +++ b/framework/src/responses/sections/beaconBooleanResponse.yaml @@ -0,0 +1,33 @@ +$schema: https://json-schema.org/draft/2020-12/schema +description: >- + Complete definition for a minimal response that provides *only* a `Boolean` + exists true|false answer. +type: object +properties: + meta: + description: >- + Information about the response that could be relevant for the Beacon + client in order to interpret the results. + $ref: ./sections/beaconResponseMeta.yaml + responseSummary: + description: >- + Boolean (true/false) response section. + $ref: ./sections/beaconBooleanResponseSection.yaml + info: + description: >- + Additional details that could be of interest. Provided to clearly + enclose any attribute that is not part of the Beacon specification. + $ref: ../common/beaconCommonComponents.yaml#/definitions/Info + beaconHandovers: + description: >- + List of handovers that apply to the whole response, not to any resultset + or result in particular. + $ref: ../common/beaconCommonComponents.yaml#/definitions/ListOfHandovers + response: + description: >- + Response for queries that recovers any result. + $ref: ./sections/beaconBooleanResultsets.yaml +required: + - meta + - responseSummary + - response diff --git a/framework/src/responses/sections/beaconBooleanResultsets.yaml b/framework/src/responses/sections/beaconBooleanResultsets.yaml new file mode 100644 index 000000000..850f67aaa --- /dev/null +++ b/framework/src/responses/sections/beaconBooleanResultsets.yaml @@ -0,0 +1,43 @@ +$schema: https://json-schema.org/draft/2020-12/schema +title: Beacon BooleanResultSet +description: Sets of results to be returned as query response. +type: object +properties: + $schema: + $ref: ../../common/beaconCommonComponents.yaml#/definitions/$schema + resultSets: + type: array + items: + $ref: '#/definitions/BooleanResultsetInstance' + minItems: 0 +required: + - resultSets +additionalProperties: true +definitions: + BooleanResultsetInstance: + properties: + id: + description: id of the Booleanresultset + type: string + example: datasetA + setType: + description: Entry type of BooleanresultSet. It SHOULD MATCH an entry type declared + as collection in the Beacon configuration. + type: string + default: dataset + exists: + type: boolean + resultsHandovers: + description: List of handovers that apply to this Booleanresultset, not to the whole + Beacon or to a result in particular. + $ref: ../../common/beaconCommonComponents.yaml#/definitions/ListOfHandovers + info: + description: Additional details that could be of interest about the BooleanResultset. + Provided to clearly enclose any attribute that is not part of the Beacon + specification. + type: object + required: + - id + - setType + - exists + additionalProperties: true diff --git a/framework/src/responses/sections/beaconCountResultsets.yaml b/framework/src/responses/sections/beaconCountResultsets.yaml new file mode 100644 index 000000000..8827c996a --- /dev/null +++ b/framework/src/responses/sections/beaconCountResultsets.yaml @@ -0,0 +1,47 @@ +$schema: https://json-schema.org/draft/2020-12/schema +title: Beacon CountResultSet +description: Sets of results to be returned as query response. +type: object +properties: + $schema: + $ref: ../../common/beaconCommonComponents.yaml#/definitions/$schema + resultSets: + type: array + items: + $ref: '#/definitions/CountResultsetInstance' + minItems: 0 +required: + - resultSets +additionalProperties: true +definitions: + CountResultsetInstance: + properties: + id: + description: id of the Countresultset + type: string + example: datasetA + setType: + description: Entry type of CountresultSet. It SHOULD MATCH an entry type declared + as collection in the Beacon configuration. + type: string + default: dataset + exists: + type: boolean + resultsCount: + description: Number of results in this CountResultset. + type: integer + resultsHandovers: + description: List of handovers that apply to this Countresultset, not to the whole + Beacon or to a result in particular. + $ref: ../../common/beaconCommonComponents.yaml#/definitions/ListOfHandovers + info: + description: Additional details that could be of interest about the CountResultset. + Provided to clearly enclose any attribute that is not part of the Beacon + specification. + type: object + required: + - id + - setType + - exists + - resultsCount + additionalProperties: true