Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 63a754c77b
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| switch (discriminatorValue) { | ||
| case "basic": | ||
| deserialized = tree.traverse(jp.getCodec()).readValueAs(BasicAuthentication.class); | ||
| newGenericConnectorAuth.setActualInstance(deserialized); | ||
| return newGenericConnectorAuth; | ||
| case "bearer": | ||
| deserialized = tree.traverse(jp.getCodec()).readValueAs(BearerTokenAuthentication.class); | ||
| newGenericConnectorAuth.setActualInstance(deserialized); | ||
| return newGenericConnectorAuth; | ||
| case "oauth_client_credentials": | ||
| deserialized = tree.traverse(jp.getCodec()).readValueAs(OauthClientCredentialsAuthentication.class); | ||
| newGenericConnectorAuth.setActualInstance(deserialized); | ||
| return newGenericConnectorAuth; | ||
| case "oauth_code": | ||
| deserialized = tree.traverse(jp.getCodec()).readValueAs(OauthCodeAuthentication.class); | ||
| newGenericConnectorAuth.setActualInstance(deserialized); | ||
| return newGenericConnectorAuth; | ||
| case "other": |
There was a problem hiding this comment.
Align auth discriminator values with enum tokens
The discriminator switch for GenericConnectorAuth expects type values like bearer, oauth_client_credentials, and other, but the enum used by the auth models serializes to hyphenated values like bearer-token, oauth-client-credentials, and other-token (see AuthenticationType). If the API returns those hyphenated values, the switch falls through and the fallback parsing attempts to match multiple schemas; because required fields are not strictly validated, more than one schema can match and deserialization throws Failed deserialization for GenericConnectorAuth: %d classes match result, expected 1. This will break responses for non-basic auth types unless the discriminator values are aligned.
Useful? React with 👍 / 👎.
No description provided.