[reportwebhooks] Code generation: update services and models#1702
Conversation
There was a problem hiding this comment.
Code Review
This pull request updates the ReportNotificationRequest model to refine the deserialization and conversion logic for the TypeEnum field, alongside updating SDK generation metadata. A review comment suggests simplifying the manual deserialization of the type property by using JsonSerializer.Deserialize directly, which would also resolve a potential nullability compiler warning.
| string? typeRawValue = utf8JsonReader.GetString(); | ||
| type = new Option<ReportNotificationRequest.TypeEnum?>(ReportNotificationRequest.TypeEnum.FromStringOrDefault(typeRawValue)); | ||
| type = new Option<ReportNotificationRequest.TypeEnum?>(ReportNotificationRequest.TypeEnum.FromStringOrDefault(typeRawValue) ?? (ReportNotificationRequest.TypeEnum)typeRawValue); |
There was a problem hiding this comment.
The typeRawValue variable is of type string?, but it is passed to FromStringOrDefault which expects a non-nullable string. This triggers a compiler warning (CS8604) in a #nullable enable context. Additionally, this manual deserialization logic is redundant because it is already implemented in the TypeEnumJsonConverter. You can simplify this by leveraging JsonSerializer.Deserialize directly, which is more maintainable and avoids the nullability issue.
type = new Option<ReportNotificationRequest.TypeEnum?>(JsonSerializer.Deserialize<ReportNotificationRequest.TypeEnum>(ref utf8JsonReader, jsonSerializerOptions));
This PR contains the automated changes for the
reportwebhooksservice.The commit history of this PR reflects the
adyen-openapicommits that have been applied.