open-formulieren / open-forms

Smart and dynamic forms
https://open-forms.readthedocs.io
Other
36 stars 26 forks source link

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

Open sergei-maertens opened 5 months ago

sergei-maertens commented 5 months ago

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

joeribekker commented 4 months ago

Refinement: Related to #3283