Skip to content

[Subscription] Remove exactly one attribute restriction for exact, prefix and suffix filters#957

Merged
duglin merged 2 commits into
cloudevents:mainfrom
pierDipi:remove-exactly-one-attribute-restriction
Feb 24, 2022
Merged

[Subscription] Remove exactly one attribute restriction for exact, prefix and suffix filters#957
duglin merged 2 commits into
cloudevents:mainfrom
pierDipi:remove-exactly-one-attribute-restriction

Conversation

@pierDipi
Copy link
Copy Markdown
Member

To improve the usage of the API in the common case, I'm removing
the restriction for exact, prefix and suffix filters of only
containing exactly one attribute.

When multiple attributes are specified, all attributes must match (
like in 1), for example, these filters:

filters:
  - suffix:
      type: "com.github.push"
  - suffix:
      subject: "https//github.com/cloudevents/spec"

can be written as:

filters:
  - suffix:
      type: "com.github.push"
      subject: "https//github.com/cloudevents/spec"

Signed-off-by: Pierangelo Di Pilato pierdipi@redhat.com

Proposed Changes

  • Remove exactly one attribute restriction for exact, prefix and suffix filters

Release Note

Remove exactly one attribute restriction for exact, prefix and suffix filters

To improve the usage of the API in the common case, I'm removing
the restriction for `exact`, `prefix` and `suffix` filters of only
containing exactly one attribute.

When multiple attributes are specified, all attributes must match (
like in [1]), for example, these filters:

```yaml
filters:
  - suffix:
      type: "com.github.push"
  - suffix:
      subject: "https//github.com/cloudevents/spec"
```

can be written as:

```yaml
filters:
  - suffix:
      type: "com.github.push"
      subject: "https//github.com/cloudevents/spec"
```

[1]: cloudevents#803

Signed-off-by: Pierangelo Di Pilato <pierdipi@redhat.com>
@pierDipi pierDipi force-pushed the remove-exactly-one-attribute-restriction branch from 2538c05 to eec8009 Compare February 21, 2022 11:26
@pierDipi
Copy link
Copy Markdown
Member Author

The CI error isn't related:

./community/demos.md: Can't load url: https://github.com/salaboy/zeebe-cloud-events-examples (tried 5 times)

@devguyio
Copy link
Copy Markdown
Contributor

Thanks for doing this! This is definitely a big improvement from a UX perspective based on the users feedback so far.

Do you mind updating the openopi schema as well? https://github.com/cloudevents/spec/blob/main/subscriptions/subscriptions-openapi.yaml

Signed-off-by: Pierangelo Di Pilato <pierdipi@redhat.com>
@duglin
Copy link
Copy Markdown
Collaborator

duglin commented Feb 23, 2022

Seems like a reasonable UX improvement/optimization
LGTM

@duglin
Copy link
Copy Markdown
Collaborator

duglin commented Feb 24, 2022

Approved on the 2/24 call

@duglin duglin merged commit a685097 into cloudevents:main Feb 24, 2022
@pierDipi pierDipi deleted the remove-exactly-one-attribute-restriction branch February 24, 2022 18:12
clemensv pushed a commit to clemensv/spec that referenced this pull request Aug 19, 2022
…efix and suffix filters (cloudevents#957)

* Remove exactly one attribute restriction for exact, prefix and suffix

To improve the usage of the API in the common case, I'm removing
the restriction for `exact`, `prefix` and `suffix` filters of only
containing exactly one attribute.

When multiple attributes are specified, all attributes must match (
like in [1]), for example, these filters:

```yaml
filters:
  - suffix:
      type: "com.github.push"
  - suffix:
      subject: "https//github.com/cloudevents/spec"
```

can be written as:

```yaml
filters:
  - suffix:
      type: "com.github.push"
      subject: "https//github.com/cloudevents/spec"
```

[1]: cloudevents#803

Signed-off-by: Pierangelo Di Pilato <pierdipi@redhat.com>

* Update subscription open API

Signed-off-by: Pierangelo Di Pilato <pierdipi@redhat.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants