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

"deliveryChannels" should be optional for updates #931

Closed
donaldgray opened this issue Jan 9, 2025 · 1 comment · Fixed by #944
Closed

"deliveryChannels" should be optional for updates #931

donaldgray opened this issue Jan 9, 2025 · 1 comment · Fixed by #944
Assignees
Labels
API https://dlcs-book.readthedocs.io/en/latest/ refined Identify refined tickets in the backlog

Comments

@donaldgray
Copy link
Member

donaldgray commented Jan 9, 2025

Currently the "deliveryChannels" property is required when updating an asset, whether that be via a batch or PUT.

This keeps the logic in API simple but pushes the complexity to the API consumer. It's then more difficult to submit updates as you either need to know what delivery-channels have been configured or issue a GET first before constructing an update.

"deliveryChannels" should be optional for both create and update operations. To accommodate this we need a mechanism to allow delivery channels for an existing asset to be "re-defaulted". This mechanism is a new special channel, "default" (similar to the special "none" channel). When "none" channel is specified we place a marker in the database, however "default" doesn't place a marker but instead sets whatever the actual defaults are.

The possible scenarios are now:

  • "deliveryChannels": []: 400 bad request whether new or existing asset (consumer needs to be more explicit)
  • "deliveryChannels": [{ "channel: "none" }]: store 'none' marker in DB whether new or existing asset
  • "deliveryChannels": [ ..explicit, valid channels.. ]: use specified values
  • "deliveryChannels": null
    • If new asset use defaults
    • If existing asset, use delivery channels already configured for asset
  • "deliveryChannels": [{ "channel: "default" }]:
    • If new asset use defaults (equivalent to null)
    • If existing asset, reset to defaults (different from null)

Note that it's only the behaviour of the last 2 bullets that change - everything else is as-is but listing for completeness

@donaldgray donaldgray added the API https://dlcs-book.readthedocs.io/en/latest/ label Jan 9, 2025
@donaldgray
Copy link
Member Author

WIP netlify docs have been updated to include a description of above https://deploy-preview-2--dlcs-docs.netlify.app/api-doc/delivery-channels#reset-to-configured-defaults

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
API https://dlcs-book.readthedocs.io/en/latest/ refined Identify refined tickets in the backlog
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants