Skip to content

Conversation

@Kwok-he-Chu
Copy link
Member

@Kwok-he-Chu Kwok-he-Chu commented Oct 28, 2025

Description

This PR addresses the upgrade of the OpenApiGenerator to v7.16.0 used in the Adyen sdk-automation to generate .NET models & services from the Adyen OpenAPI Specifications. This PR addresses allOf support and native support for System.Text.Json.


Release notes (WIP)

Added new functionality

Folder-structure

  • Introduced a /Core-folder with the following functionality:
    • /Auth contains classes to add authorization to HttpHeaders.
    • /Client contains classes that wrap the ApiResponses and help-functionality to construct the LiveUrl (see UrlBuilderExtensions.cs)
    • /Client/Extensions/ contains the Polly-library that allows user to configure Timeouts, Retries and CircuitBreakers.
    • /Converters contains JsonConverters for DateOnly, DateOnlyNullable, DateTime and DateTimeNullable
    • /Options contains classes to configure the AdyenOptions or AdyenEnvironment (Test/Live).
  • All APIs are now part of their own sub-folders
  • Support DateTimeOffSet
    • Before: new DateTime(2025, 12, 25, 11, 59, 59)
    • -> After: new DateTimeOffset(2025, 12, 25, 11, 59, 59, TimeSpan.Zero)
  • Support DateTimeOnly
    • Before: new DateTime(2025, 12, 25, 11, 59, 59)
    • -> After: new DateOnly(2025, 12, 25)

Mustache templates

  • Added api_doc.mustache - Allows documentation generation in /docs folder, only the Service-classes are generated, showing developers how to interact with the API
  • Added WebhookHandler.mustache - Allows the WebhookHandler.cs to be generated for deserializing webhooks
  • Added modelInnerEnum.mustache, all generated enums are now strings and forward compatible, this fixes Discussion: Should we make the enums forward-compatible? #1071
  • Added templates to generate the new models (modelGeneric.mustache) and services (api.mustache), supporting allOf

Changes - Moved classes

  • Removed .NET 6.0 in .csproj.
  • Moved all TerminalApi classes to the /TerminalApi folder
    • Adyen/Service/TerminalApiAsyncService -> Adyen/**TerminalApi**/Service/TerminalApiService
    • Adyen/Service/TerminalApiSyncService -> Adyen/**TerminalApi**/Service/TerminalSyncService
    • Adyen/Service/TerminalApiLocalService -> Adyen/**TerminalApi**/Service/TerminaLocalService
    • Adyen/Service/TerminalLocalApiUnencrypted -> Adyen/**TerminalApi**/Service/TerminalLocalApiUnencrypted
    • Adyen/Service/TerminalCloudApi -> Adyen/**TerminalApi**/Service/TerminalCloudApi
    • Adyen/Service/TerminalLocalApi -> Adyen/**TerminalApi**/Service/TerminalLocalApi

Breaking changes - Renames

  • Renamed & Moved Adyen/Util/HMACValidator.cs -> Adyen/Webhooks/HmacValidatorUtility.

  • Removed BalancePlatformWebhookHandler, ClassicPaltformWebhookhandler, ManagementWebhookHandler


Prerequisites

  • Upgraded to .NET 8.0 in this PR.
  • Review generated models this branch
  • Review and approve this PR for sdk-automation - This contains the pipeline changes & configuration for model/service-generation.
  • Review this PR with the changes made to /Core and in the new mustache.templates

@Kwok-he-Chu Kwok-he-Chu changed the title Upgrade OpenApiGenerator to v7+ to support allOf/type, System.Text.Json, and more Upgrade OpenApiGenerator to v7.16.0 to generate new .NET models/services to support allOf/type, System.Text.Json Nov 7, 2025
Adyen.Core.Client.Extensions.HttpRequestMessageExtensions.AdyenLibraryName
Adyen.Core.Client.Extensions.HttpRequestMessageExtensions.AdyenLibraryVersion
Small summary/comments fixes
…is removed it compiles

Remove /Util folder, no longer used in root
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Discussion: Should we make the enums forward-compatible?

2 participants