-
Notifications
You must be signed in to change notification settings - Fork 27
Expand file tree
/
Copy pathpython_speakeasy.yaml
More file actions
88 lines (77 loc) · 3.61 KB
/
Copy pathpython_speakeasy.yaml
File metadata and controls
88 lines (77 loc) · 3.61 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
# Speakeasy overlay for Python SDK-specific customizations.
# Applied on top of the upstream API spec before code generation.
#
# See: https://www.speakeasy.com/docs/customize-sdks/overlays
overlay: 1.0.0
info:
title: Python SDK Overlay
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."
# 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')."