Skip to content

feat: Enable arbitrary input for ConnectorType enums #304

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

Merged
merged 1 commit into from
Aug 6, 2025

Conversation

awalker4
Copy link
Collaborator

@awalker4 awalker4 commented Aug 6, 2025

Use the openapi overlay file to add x-speakeasy-unknown-values to the models for SourceConnectorType and DestinationConnectorType. This allows the client to send any string outside of the enum definitions. This provides forward compatibility in the client, we can create sources with types that don't exist yet, without requiring a new client version.

Example:

This throws an error that the type is not in our enum. Now, it just warns that this is an unknown value, but it's sent to the server anyway.

res = unstructured_client.sources.create_source(
    request={
        "create_source_connector": {
            "name": "My fancy new source",
            "type": "future_source_type",
            "config": {
                ...
                ...
            }
        }
    }
)

The change will take effect when the client regenerates and uses the new overlay config. By setting
gen.yaml to 0.42.2, the new client will propagate this version change.

Use the openapi overlay file to add `x-speakeasy-unknown-values` to the models for
`SourceConnectorType` and `DestinationConnectorType`. This allows the client to send any string
outside of the enum definitions. This provides forward compatibility in the client, we can create
sources with types that don't exist yet, without requiring a new client version.

Example:

This throws an error that the type is not in our enum. Now, it just warns that this is an unknown
value, but it's sent to the server anyway.

```
res = unstructured_client.sources.create_source(
    request={
        "create_source_connector": {
            "name": "My fancy new source",
            "type": "future_source_type",
            "config": {
                ...
                ...
            }
        }
    }
)
'''

The change will take effect when the client regenerates and uses the new overlay config. By setting
`gen.yaml` to `0.42.2`, the new client will propagate this version change.
@awalker4 awalker4 requested a review from gavinchen2025 August 6, 2025 20:04
@awalker4 awalker4 enabled auto-merge (squash) August 6, 2025 20:23
@awalker4 awalker4 merged commit 9464074 into main Aug 6, 2025
13 checks passed
@awalker4 awalker4 deleted the fix/allow-arbitrary-connector-types branch August 6, 2025 22:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants