Uploaded image for project: 'FlightPath'
  1. FlightPath
  2. FLPATH-1051

[Orchestrator-API] remove date-time format from openapi spec

XMLWordPrintable

    • False
    • Hide

      None

      Show
      None
    • False

      Description of the problem:

      Date time is not currently compatible with all client languages. In order to keep maximum compatibility we should remove date-time format from openapi spec to prevent decoding errors from auto generated clients.

      Recommendations

      To make your API compatible:

      1. Use RFC-3339 date and date-time formats. Even if you have different internal formats, such as for interfacing with databases, do a time conversion if your API layer to publish and consume RFC-3339 date and time formats.
      2. If you cannot use RFC-3339, use type=string and do not use format=date or format=date-time

      How reproducible:

      100%

      Steps to reproduce:

      1. Generate python client

      2.. GET https://backstage-backstage-backstage-system.apps.ocp-edge128-0.qe.lab.redhat.com/api/orchestrator/v2/workflows/instances

      3. FAILED api_tests/test_orchestrator.py::test_get_workflow_run_instances - ValueError: invalid literal for int() with base 10: b'2/27'

      Actual results:

      FAILED api_tests/test_orchestrator.py::test_get_workflow_run_instances - ValueError: invalid literal for int() with base 10: b'2/27'

      Expected results:

      Pass - data is returned 

      Tested fix by replacing the started format date in the openapi spec:

      ProcessInstanceDTO:
      type: object
      properties:
      id:
      type: string
      name:
      type: string
      workflow:
      type: string
      status:
      $ref: '#/components/schemas/ProcessInstanceStatusDTO'
      started:
      type: string

              gciavarrini@redhat.com Gloria Ciavarrini
              gharden1 Gary Harden
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated:
                Resolved: