Skip to content

OpenAPI spec inconsistency with ConnectionSchedule inside ConnectionRead schema #7466

@azhard

Description

@azhard

Enviroment

  • Airbyte version: 0.30.22-alpha
  • OS Version / Instance: GCP n2.
  • Deployment: GCP Compute Engine
  • Source Connector and version: N/A
  • Destination Connector and version: N/A
  • Severity: Low
  • Step where error happened: Setup

Current Behavior

I've created an Airbyte config manager that my company uses to store and programatically update Airbyte's source, destinations, and connections. This is all handled through Airbyte's API spec and through an API client generated from the openapi-python-client library.

The issue I've ran into specifically relates to the ConnectionSchedule API resource schema (although it might apply to others as well). In the Open API spec, the ConnectoinRead schema, which contains the ConnectionSchedule in its properties, doesn't mark ConnectionSchedule as nullable: true. The problem there is that if there is a manual schedule for the connection, the response for the connection get includes a null value for the schedule.

More tangibly the response for connection get with a manual schedule will look like:

{
   "schedule":null,
   
   "connectionId":...,
   "name":...,
   "namespaceDefinition":...,
   "namespaceFormat":...,
   "prefix":...,
   "sourceId":...,
   "destinationId":...,
   "operationIds":[],
   "syncCatalog":{...},
   "status":"active",
   "resourceRequirements":{...}
}

As mentioned above this doesn't line up with the Open API spec as it doesn't indicate that the schedule can be null for this request.

All of this is fine if someone is sending manual requests to get a connection with a manual schedule, but this breaks when using an OpenAPI client library generator like the one mentioned above.

Expected Behavior

The fix here in my opinion is either:
a) update the API spec to mark the schedule as nullable like so:

    ConnectionRead:
        ...
        schedule:
          nullable: true
          allOf:
            - $ref: "#/components/schemas/ConnectionSchedule"

b) don't emit the schedule key in the /v1/connections/get response if the schedule is manual

Logs

N/A

Steps to Reproduce

N/A

Are you willing to submit a PR?

Happy to - can make the Open API change easily but if the identified correct solution is b will need guidance on where that response is being emitted from.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions