open-forms icon indicating copy to clipboard operation
open-forms copied to clipboard

Co-sign data validation serializer is not compatible with co-sign v2 flow.

Open sergei-maertens opened this issue 9 months ago • 1 comments

Product versie / Product version

master / stable versions

Omschrijf het probleem / Describe the bug

Discovered in #4305

The serializer used for (model field) validation only supports the legacy co-sign flow: https://github.com/open-formulieren/open-forms/blob/e780ea782eb2264dc63cf33dd19c67d57a7a15c2/src/openforms/submissions/models/submission.py#L124-L130

This highlights that the serializer is outdated, but also that it's not being called to check the input data.

Related information: #3149 has a bullet about moving the co sign data into a proper model rather than using a JSONField. The main problem here is that the shape of data is ambiguous/not clear from looking at the data model. The wrong serializer even describes an incorrect shape of data, which makes developing with this feature harder than it should be.

When we enforce validation on save, about 20 tests fail, per this comment

sergei-maertens avatar May 17 '24 12:05 sergei-maertens