-
Notifications
You must be signed in to change notification settings - Fork 27
feat: add overlay to remove connector-specific models from generated SDK #185
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
Aaron ("AJ") Steers (aaronsteers)
wants to merge
5
commits into
main
Choose a base branch
from
devin/1782192010-remove-connector-models
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 2 commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
5cc1353
feat: add overlay to remove connector-specific models from generated SDK
devin-ai-integration[bot] c9e4f96
fix: use remove actions for oneOf/enum arrays instead of null
devin-ai-integration[bot] bfa15a0
chore: regenerate SDK with Speakeasy
octavia-bot[bot] 19b7f73
chore: merge main into PR branch
devin-ai-integration[bot] a7eefcc
chore: regenerate SDK with Speakeasy
octavia-bot[bot] File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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." | ||
|
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')." | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.