Skip to content

The DestinationConfig.settings json-schema/validator/serializer/form needs to be versionable #1793

@hmpf

Description

@hmpf

We're moving the synced-field from the email media-plugin to all media plugins, by making a new field on DestinationConfig (see poll #1791 for name).

The validation of the settings-field is done by the media plugin. The v2 API for the email media plugin has a response serializer that sends out

  {
    "pk": 12,
    "media": {
      "slug": "email",
      "name": "Email",
      "installed": true
    },
    "label": null,
    "suggested_label": "Email: a@b.ca",
    "settings": {
      "synced": true,
      "email_address": "a@b.ca"
    }
  },

synced inside settings cannot be altered and is ignored in the request serializer.

v3 would send:

  {
    "pk": 12,
    "media": {
      "slug": "email",
      "name": "Email",
      "installed": true
    },
    "label": null,
    "suggested_label": "Email: a@b.ca",
    "settings": {
      "email_address": "a@b.ca"
    },
    "NAME_TO_BE_DETERMINED": true
  },

instead. "NAME_TO_BE_DETERMINED" behaves just like synced, it cannot be altered by API/frontend and is ignored in the request serializer.

The cleaning of the contents of settings should still be handled by the plugin, but that means we need to be able to version plugins somehow, while v2 and v3 co-exist.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    Status

    📋 Backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions