Skip to content

[binlookup] Code generation: update services and models#1697

Merged
gcatanese merged 1 commit into
mainfrom
sdk-automation/binlookup
May 21, 2026
Merged

[binlookup] Code generation: update services and models#1697
gcatanese merged 1 commit into
mainfrom
sdk-automation/binlookup

Conversation

@AdyenAutomationBot

Copy link
Copy Markdown
Collaborator

This PR contains the automated changes for the binlookup service.

The commit history of this PR reflects the adyen-openapi commits that have been applied.

@AdyenAutomationBot
AdyenAutomationBot requested a review from a team as a code owner May 21, 2026 11:53

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request updates the SDK generation log and modifies the deserialization logic for ShopperInteractionEnum, ContractEnum, and TokenServiceEnum to include a fallback mechanism. Feedback suggests replacing the manual deserialization logic with JsonSerializer.Deserialize to leverage existing converters and avoid potential nullability warnings.

Comment on lines 406 to +407
string? shopperInteractionRawValue = utf8JsonReader.GetString();
shopperInteraction = new Option<CostEstimateRequest.ShopperInteractionEnum?>(CostEstimateRequest.ShopperInteractionEnum.FromStringOrDefault(shopperInteractionRawValue));
shopperInteraction = new Option<CostEstimateRequest.ShopperInteractionEnum?>(CostEstimateRequest.ShopperInteractionEnum.FromStringOrDefault(shopperInteractionRawValue) ?? (CostEstimateRequest.ShopperInteractionEnum)shopperInteractionRawValue);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The manual deserialization logic for shopperInteraction is redundant and potentially problematic. ShopperInteractionEnum already has a dedicated JsonConverter (ShopperInteractionEnumJsonConverter) that handles the mapping and forward compatibility correctly.

Furthermore, passing shopperInteractionRawValue (which is a string?) directly to FromStringOrDefault (which expects a non-nullable string) can trigger a compiler warning (CS8625) when the value is null.

Using JsonSerializer.Deserialize is more idiomatic, leverages the existing converter, and avoids these issues.

                            shopperInteraction = new Option<CostEstimateRequest.ShopperInteractionEnum?>(JsonSerializer.Deserialize<CostEstimateRequest.ShopperInteractionEnum>(ref utf8JsonReader, jsonSerializerOptions)!);

Comment on lines 475 to +476
string? contractRawValue = utf8JsonReader.GetString();
contract = new Option<Recurring.ContractEnum?>(Recurring.ContractEnum.FromStringOrDefault(contractRawValue));
contract = new Option<Recurring.ContractEnum?>(Recurring.ContractEnum.FromStringOrDefault(contractRawValue) ?? (Recurring.ContractEnum)contractRawValue);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The manual deserialization logic for contract is redundant because ContractEnum already has a dedicated JsonConverter. Additionally, passing a nullable string to FromStringOrDefault may cause compiler warnings. It is better to use JsonSerializer.Deserialize to leverage the existing converter logic.

                            contract = new Option<Recurring.ContractEnum?>(JsonSerializer.Deserialize<Recurring.ContractEnum>(ref utf8JsonReader, jsonSerializerOptions)!);

Comment on lines 488 to +489
string? tokenServiceRawValue = utf8JsonReader.GetString();
tokenService = new Option<Recurring.TokenServiceEnum?>(Recurring.TokenServiceEnum.FromStringOrDefault(tokenServiceRawValue));
tokenService = new Option<Recurring.TokenServiceEnum?>(Recurring.TokenServiceEnum.FromStringOrDefault(tokenServiceRawValue) ?? (Recurring.TokenServiceEnum)tokenServiceRawValue);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Similar to the contract property, the manual deserialization for tokenService should be replaced with JsonSerializer.Deserialize to maintain consistency and reuse the logic defined in TokenServiceEnumJsonConverter.

                            tokenService = new Option<Recurring.TokenServiceEnum?>(JsonSerializer.Deserialize<Recurring.TokenServiceEnum>(ref utf8JsonReader, jsonSerializerOptions)!);

@gcatanese
gcatanese added this pull request to the merge queue May 21, 2026
Merged via the queue into main with commit 4f519b3 May 21, 2026
2 checks passed
@gcatanese
gcatanese deleted the sdk-automation/binlookup branch May 21, 2026 12:57
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