XMLWordPrintable

    • Icon: Story Story
    • Resolution: Unresolved
    • Icon: Major Major
    • None
    • None
    • RHODS
    • 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.

      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: ...
      

            rh-ee-dripberg Drew Ripberger
            kpouget2 Kevin Pouget
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: