From f05f4d3a2bf26503d203d9084d8961bd21d84fa8 Mon Sep 17 00:00:00 2001 From: Ludovic Robert <30499179+bigludo7@users.noreply.github.com> Date: Thu, 10 Oct 2024 13:58:53 +0200 Subject: [PATCH] Update event-subscription-template.yaml Proposal for https://github.com/camaraproject/Commonalities/issues/276 - POST /subscriptions response will have only `id` - removed `sinkCredentials` from GET representation --- .../event-subscription-template.yaml | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/artifacts/camara-cloudevents/event-subscription-template.yaml b/artifacts/camara-cloudevents/event-subscription-template.yaml index 63c2aff1..32deaa7d 100644 --- a/artifacts/camara-cloudevents/event-subscription-template.yaml +++ b/artifacts/camara-cloudevents/event-subscription-template.yaml @@ -98,7 +98,7 @@ paths: content: application/json: schema: - $ref: "#/components/schemas/Subscription" + $ref: "#/components/schemas/SubscriptionCreationResponse" "202": description: Request accepted to be processed. It applies for async creation process. headers: @@ -294,7 +294,7 @@ components: sink: type: string format: url - description: The address to which events shall be delivered, using the HTTP protocol. + description: The address to which events shall be delivered using the selected protocol. example: "https://endpoint.example.com/sink" sinkCredential: $ref: "#/components/schemas/SinkCredential" @@ -460,6 +460,15 @@ components: - org.camaraproject.api-name.v0.event-type - org.camaraproject.api-name.v0.subscription-ends + SubscriptionCreationResponse: + description: Response for the POST request + type: object + required: + - id + properties: + id: + $ref: '#/components/schemas/SubscriptionId' + Subscription: description: Represents a event-type subscription. type: object @@ -477,8 +486,6 @@ components: format: url description: The address to which events shall be delivered using the selected protocol. example: "https://endpoint.example.com/sink" - sinkCredential: - $ref: '#/components/schemas/SinkCredential' types: description: | Camara Event types eligible to be delivered by this subscription. @@ -634,14 +641,13 @@ components: - MAX_EVENTS_REACHED - Maximum number of events (optionally set by the requester) has been reached - ACCESS_TOKEN_EXPIRED - Access Token sinkCredential (optionally set by the requester) expiration time has been reached - SUBSCRIPTION_DELETED - Subscription was deleted by the requester - - SUBSCRIPTION_UNPROCESSABLE - Subscription cannot be processed due to some reason, e.g. because the specified area cannot be managed. Useful for asynchronous subscription creation. enum: - MAX_EVENTS_REACHED - NETWORK_TERMINATED - SUBSCRIPTION_EXPIRED - ACCESS_TOKEN_EXPIRED - SUBSCRIPTION_DELETED - - SUBSCRIPTION_UNPROCESSABLE + HTTPSubscriptionRequest: allOf: - $ref: "#/components/schemas/SubscriptionRequest"