Skip to content

Commit 9464074

Browse files
authored
feat: Enable arbitrary input for ConnectorType enums (#304)
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.
1 parent 108e239 commit 9464074

File tree

3 files changed

+25
-1
lines changed

3 files changed

+25
-1
lines changed

CHANGELOG.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,21 @@
1+
## 0.42.2
2+
3+
### Enhancements
4+
5+
### Features
6+
* Enable arbitrary inputs for `SourceConnectorType` and `DestinationConnectorType`. This lets the client support new connector types without having to upgrade.
7+
8+
### Fixes
9+
10+
## 0.42.1
11+
12+
### Enhancements
13+
14+
### Features
15+
16+
### Fixes
17+
* potential issue referencing models before declaration (commit by @mfbx9da4)
18+
119
## 0.42.0
220

321
### Enhancements

gen.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ generation:
1818
generateNewTests: false
1919
skipResponseBodyAssertions: false
2020
python:
21-
version: 0.42.1
21+
version: 0.42.2
2222
additionalDependencies:
2323
dev:
2424
deepdiff: '>=6.0'

overlay_client.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,3 +77,9 @@ actions:
7777
- target: $["components"]["schemas"]["partition_parameters"]["properties"]["tracking_enabled"]
7878
description: Remove tracking_enabled from partition_parameters
7979
remove: true
80+
- target: $["components"]["schemas"]["SourceConnectorType"]
81+
update:
82+
"x-speakeasy-unknown-values": "allow"
83+
- target: $["components"]["schemas"]["DestinationConnectorType"]
84+
update:
85+
"x-speakeasy-unknown-values": "allow"

0 commit comments

Comments
 (0)