uwazi
uwazi copied to clipboard
Revisit the media field API validation and/or database type
During #5702 it was discovered that all information for media metadata is sent to the api and then stored as a simple string. The possible options discussed are:
- Keep things as they are, but still try to validate the string.
- Change the interface between the front-end and the api: they should send a properly defined object, but the back-end still stores the string. The reason this was mentioned is that this avoids the potentially costly rework of the back-end processes, and the necessary migration.
- The full solution would be to introduce a new type for media fields, change both the back-end and front-end to work with it. This also includes a migration to transform the string records into the new type.
Note that this can be broken up into multiple steps if need be, as the above are incrementally building on each other. For example, the validation process for the string involves breaking it up into an object, which is also the migration step in the full solution, the interface change between the front-end and back-end can be done separately, etc.