Skip to content
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions .speakeasy/workflow.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,8 @@ sources:
airbyte-api:
inputs:
- location: https://raw.githubusercontent.com/airbytehq/airbyte-platform/refs/heads/main/airbyte-api/server-api/src/main/openapi/api_sdk.yaml
# Uncomment when the overlay has real actions (empty overlays produce
# an empty document in Speakeasy CLI, which fails linting):
# overlays:
# - location: ./overlays/python_speakeasy.yaml
overlays:
- location: ./overlays/python_speakeasy.yaml
Comment thread
aaronsteers marked this conversation as resolved.
registry:
location: registry.speakeasyapi.dev/airbyte/airbyte-prod/my-source
targets:
Expand Down
85 changes: 80 additions & 5 deletions overlays/python_speakeasy.yaml
Original file line number Diff line number Diff line change
@@ -1,13 +1,88 @@
# Speakeasy overlay for Python SDK-specific customizations.
# Applied on top of the upstream API spec before code generation.
#
# This file is currently a no-op placeholder. Add overlay actions here
# when Python SDK-specific schema tweaks are needed.
#
# See: https://www.speakeasy.com/docs/customize-sdks/overlays

overlay: 1.0.0
info:
title: Python SDK Overlay
version: 0.0.0
actions: []
version: 0.1.0
actions:
# ---------------------------------------------------------------------------
# Remove individual connector configuration schemas.
#
# The upstream spec defines ~600 source-* and ~90 destination-* schemas that
# enumerate every connector's configuration fields. These schemas are only
# reachable via the SourceConfiguration / DestinationConfiguration oneOf
# unions. Replacing those unions with a generic typed-dict object eliminates
# the need for all the individual connector models and shrinks the generated
# SDK by ~600 Python files and ~1,800 doc files (~14 MB).
#
# Users pass configuration as a plain dict with a required sourceType /
# destinationType discriminator; the API validates the full schema server-side.
# ---------------------------------------------------------------------------

# Step 1: Remove the oneOf arrays from the configuration union schemas.
# (Must be separate remove actions because `update` with null is not valid for arrays.)

- target: "$.components.schemas.SourceConfiguration.oneOf"
remove: true

- target: "$.components.schemas.DestinationConfiguration.oneOf"
remove: true

- target: "$.components.schemas.OAuthCredentialsConfiguration.oneOf"
remove: true

- target: "$.components.schemas.OAuthActorNames.enum"
remove: true

# Step 2: Update the schemas with generic object / string types.

# SourceConfiguration: generic object with required sourceType discriminator
- target: "$.components.schemas.SourceConfiguration"
update:
description: >-
The values required to configure the source.
Must include a `sourceType` string identifying the connector (e.g. 'postgres', 'github').
Additional properties depend on the connector type; the API validates the full schema server-side.
example: { sourceType: "postgres", host: "localhost", port: 5432 }
type: object
additionalProperties: true
required:
- sourceType
properties:
sourceType:
type: string
description: "The type of source connector."
Comment thread
aaronsteers marked this conversation as resolved.

# DestinationConfiguration: generic object with required destinationType discriminator
- target: "$.components.schemas.DestinationConfiguration"
update:
description: >-
The values required to configure the destination.
Must include a `destinationType` string identifying the connector (e.g. 'postgres', 'bigquery').
Additional properties depend on the connector type; the API validates the full schema server-side.
example: { destinationType: "postgres", host: "localhost", port: 5432 }
type: object
additionalProperties: true
required:
- destinationType
properties:
destinationType:
type: string
description: "The type of destination connector."

# OAuthCredentialsConfiguration: generic object
- target: "$.components.schemas.OAuthCredentialsConfiguration"
update:
description: "OAuth credentials configuration for the connector."
example: { client_id: "your-client-id", client_secret: "your-client-secret" }
type: object
additionalProperties: true

# OAuthActorNames: plain string (forward-compatible with new connectors)
- target: "$.components.schemas.OAuthActorNames"
update:
type: string
description: "The name of the OAuth-enabled connector (e.g. 'github', 'google-ads')."
Loading