Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
maxl2287 opened this issue Jun 13, 2024 · 0 comments · Fixed by #236
Labels
correction correction in documentation

Comments

@maxl2287
Copy link
Contributor

maxl2287 commented Jun 13, 2024

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

@maxl2287 maxl2287 added the correction correction in documentation label Jun 13, 2024
@maxl2287 maxl2287 changed the title [Subscriptions-template]: Setting a minItems: 1 for types in subscription-requests [Subscriptions-template]: Setting a minItems: 1 & maxItems: 1 for types in subscription-requests Jun 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
correction correction in documentation
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant