diff --git a/source-genesys/source_genesys/models.py b/source-genesys/source_genesys/models.py index c9a6f996f..d53f96b14 100644 --- a/source-genesys/source_genesys/models.py +++ b/source-genesys/source_genesys/models.py @@ -22,7 +22,10 @@ } ) -OAuth2Credentials = ClientCredentialsOAuth2Credentials +# The class name appears in the UI's Authentication section, so we wrap the non-user friendly name in a slighly better name. +# TODO(alex): figure out why the class name is appearing in the UI & determine if there's some property to set that overrides it. +class OAuth(ClientCredentialsOAuth2Credentials): + pass def default_start_date(): @@ -55,8 +58,9 @@ class EndpointConfig(BaseModel): ] = Field( title="Genesys Cloud Domain" ) - credentials: OAuth2Credentials = Field( + credentials: OAuth = Field( title="Authentication", + discriminator="credentials_title" ) diff --git a/source-genesys/tests/snapshots/snapshots__spec__capture.stdout.json b/source-genesys/tests/snapshots/snapshots__spec__capture.stdout.json index 896a7b49c..b057ebd93 100644 --- a/source-genesys/tests/snapshots/snapshots__spec__capture.stdout.json +++ b/source-genesys/tests/snapshots/snapshots__spec__capture.stdout.json @@ -3,7 +3,7 @@ "protocol": 3032023, "configSchema": { "$defs": { - "ClientCredentialsOAuth2Credentials": { + "OAuth": { "properties": { "credentials_title": { "const": "OAuth Credentials", @@ -29,7 +29,7 @@ "client_id", "client_secret" ], - "title": "ClientCredentialsOAuth2Credentials", + "title": "OAuth", "type": "object" } }, @@ -62,7 +62,17 @@ "type": "string" }, "credentials": { - "$ref": "#/$defs/ClientCredentialsOAuth2Credentials", + "discriminator": { + "mapping": { + "OAuth Credentials": "#/$defs/OAuth" + }, + "propertyName": "credentials_title" + }, + "oneOf": [ + { + "$ref": "#/$defs/OAuth" + } + ], "title": "Authentication" } },