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

Added a new until property to any event consumption strategies #997

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

cdavernas
Copy link
Member

Please specify parts of this PR update:

  • Specification
  • Schema
  • Examples
  • Extensions
  • Use Cases
  • Community
  • CTK
  • Other

Discussion or Issue link:

Closes #992

What this PR does:

Added a new until property to any event consumption strategies

Additional information:

We need to find a smart way to forbid an until event consumption strategy to itself define the until property.

@cdavernas cdavernas added change: documentation Improvements or additions to documentation. It won't impact a version change. change: feature New feature or request. Impacts in a minor version change area: spec Changes in the Specification labels Aug 28, 2024
@cdavernas cdavernas added this to the v1.0.0 milestone Aug 28, 2024
@cdavernas
Copy link
Member Author

@matthias-pichler Any suggestion on how to achieve the following in a brief, concise fashion?

We need to find a smart way to forbid an until event consumption strategy to itself define the until property.

- type: string
title: AnyEventUntilCondition
description: A runtime expression condition evaluated after consuming an event and which determines whether or not to continue listening.
- $ref: '#/$defs/eventConsumptionStrategy'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If I understood correctly, we would have to create a new EventConsumption type here to avoid the infinity mirror effect. 😆

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Precisely!!!

items:
$ref: '#/$defs/eventFilter'
required: [ any ]
oneOf:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of a oneOf we could use the if then feature of json schema which would allows us to still validate that until is required when any is empty but only generate on type/class instead of two

- callDoctor:
listen:
to:
any: []
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ideally we should test the schema by adding a failing example (under .ci/validation/test/fixtures/failing) where any is empty and until missing

@matthias-pichler
Copy link
Collaborator

@matthias-pichler Any suggestion on how to achieve the following in a brief, concise fashion?

We need to find a smart way to forbid an until event consumption strategy to itself define the until property.

Hmm we could do it with allOf

until:
  oneOf:
    - type: string
    - allOf:
        - $ref: #/$defs/eventConsumptionStrategy
        - type: object
          properties:
            until: false

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: spec Changes in the Specification change: documentation Improvements or additions to documentation. It won't impact a version change. change: feature New feature or request. Impacts in a minor version change
Projects
Status: No status
Development

Successfully merging this pull request may close these issues.

Add a new until (optional) property to Event Consumption Strategies of type any
3 participants