Notification API: pass event type in HTTP path instead of query #198
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Based on refactor-3, from #196.
This is a change to the API, a part of the proposal in #159.
The splitting of the event affordance from one to three (#196) resulted in a strange-looking API specification. In other words, this PR is mostly a change to make the spec look nicer.
Functionality-wise, this change will make it harder / less efficient if a client wants to subscribe to a subset of events (more than one, but not all). HTTP/2 multiplexes such subscriptions but the server and clients still need to allocate additional memory to handle concurrent subscriptions.
Thinking about MQTT as a future extension, this change makes it much easier to have a 1-to-1 mapping. In MQTT, there is no way to subscribe to a subset of events in a single SUB operation. It would be either one (e.g. topic things/create) or all (e.g. topic: things/+). Multiple subscriptions in MQTT share a single connection, similar to SSE over HTTP/2.
In general, I am in favor of this change.
The current API:
e.g. expansion:
/events?type=create&diff=true
one event/events?diff=true
all eventsis being changed to:
e.g. expansion:
/events/create?diff=true
one event/events?diff=true
all eventsPreview | Diff