Skip to content

[Subscriptions-template]: Setting a minItems: 1 & maxItems: 1 for types in subscription-requests #235

@maxl2287

Description

@maxl2287

Problem description
It's required to set the types-attribute in the subscription-request.
But it's not defined that minimum one item has to be set.
But without even one type a subscription does not make sense.

Also, at least for this the upcoming meta-release v0.4.0, we should limit the maximum as well to 1.

    SubscriptionRequest:
      description: The request for creating a event-type event subscription
      type: object
      required:
        - sink
        - protocol
        - config
        - types
      properties:
       #...
        types:
          description: |
            Camara Event types eligible to be delivered by this subscription.
            Note: As of now we enforce to have only event type per subscription.
          type: array
          items:
            $ref: "#/components/schemas/SubscriptionEventType"
       #...

Expected behavior

    SubscriptionRequest:
      description: The request for creating a event-type event subscription
      type: object
      required:
        - sink
        - protocol
        - config
        - types
      properties:
       #...
        types:
          description: |
            Camara Event types eligible to be delivered by this subscription.
            Note: As of now we enforce to have only event type per subscription.
          type: array
          minItems: 1
          maxItems: 1
          items:
            $ref: "#/components/schemas/SubscriptionEventType"
       #...

Source
https://github.com/camaraproject/Commonalities/blob/main/artifacts/camara-cloudevents/event-subscription-template.yaml#L305-L312

Metadata

Metadata

Assignees

No one assigned

    Labels

    correctioncorrection in documentation

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions