-
Story
-
Resolution: Obsolete
-
Major
-
None
-
None
-
None
-
False
-
False
-
None
User Story:
As a PSAP engineer, I want to be able to define multiple versions of the Pydantic model of the LTS payload, so that I can properly validate each version.
- Take the model of the notebooks performance test.
- Take a payload that matches this model.
At this stage, we're happy.
Now we want to introduce either a new KPI (in this file) or add a metadata field.
If we do it right away, we'll be able to create new payloads and validate them, but we won't be able to parse the old ones.
If we add the fields as optional, we might successfully parse some chimeric payloads (with some fields missing) as valid.
What I would like instead is to be able to rely on a version indicator to parse the payload with the right model.
And maybe duplicate the model into v1, v2 ... packages when they get replaced (or find another way that avoid duplication, if there is one).
In the processing code, we should end up with something like this, to avoid trying to access missing fields:
if v1: ... if v2: ...