camaraproject / DeviceStatus

Repository to describe, develop, document and test the Device Status API family
Apache License 2.0
11 stars 33 forks source link

`subscriptionExpireTime` is declared as "required" in the subscription-ends - note, but is optional currently #116

Closed maxl2287 closed 4 months ago

maxl2287 commented 4 months ago

Problem description

In the note for a subscription-ends event the subscriptionExpireTime is declared as "required by the requester". But this request-parameter in POST /subscriptions is not mandatory.

Expected behavior Remove "required by the requester".

Alternative solution Add subscriptionExpireTime as mandatory parameter

Additional context

subscriptionExpireTime is optional
CreateSubscription:
      description: The request for creating a Device Status event subscription
      type: object
      required:
        - webhook
        - subscriptionDetail
      properties:
        subscriptionDetail:
          $ref: "#/components/schemas/SubscriptionDetail"
        subscriptionExpireTime:
          type: string
          format: date-time
          example: 2023-01-17T13:18:23.682Z
          description: The subscription expiration time in date-time format.
        webhook:
          $ref: "#/components/schemas/Webhook"
sachinvodafone commented 4 months ago

Referring to the "subscription end" event outlined in the API guidelines as

Specific event notification type "subscription-ends" is defined to inform listener about subscription termination. It is used when the subscription expire time (required by the requester) has been reached or if the API server has to stop sending notification prematurely. For this specific event, the data must feature terminationReason attribute.

So I believe , it aligns well with "subscription-ends," signifying that the "subscriptionExpireTime" should always be provided by the requester to make it effect.

maxl2287 commented 4 months ago

Hi @sachinvodafone,

I reference now to the discussion with @bigludo7: https://github.com/camaraproject/DeviceStatus/discussions/105

What do you think about that? Should it still be optional?

sachinvodafone commented 4 months ago

I do have some confusion over "subscriptionExpireTime" and "expiresAt" so created a discussion 147