brevo-php icon indicating copy to clipboard operation
brevo-php copied to clipboard

Update SDK generator to OpenAPI Generator

Open lordofweb opened this issue 1 year ago • 1 comments

Description

This PR proposes a major update of the SDK generator by migrating from swagger-codegen to OpenAPI Generator, while maintaining compatibility with the existing SDK structure.

Main changes:

  • Migration from swagger-codegen to OpenAPI Generator
  • PHP 8.1 support
  • Addition of OpenAPI Generator configuration file (config-openapi-generator.yml)
  • Creation of custom templates to maintain consistency with previously generated code
  • Update of API models and endpoints

Technical benefits:

  1. Generated code modernization

    • Full PHP 8.1 support
    • Better strict type handling
    • Cleaner and better documented code
  2. Improved maintenance

    • Centralized configuration in config-openapi-generator.yml
    • Custom templates for better generated code control
    • Easier to update with future API versions
  3. Best practices

    • Use of latest OpenAPI features
    • Improved documentation
    • Updated unit tests

How to test

To generate the SDK with the new configuration:

openapi-generator generate --skip-validate-spec -c config-openapi-generator.yml

Migration notes

  • General SDK structure remains the same to maintain compatibility
  • Namespaces and file organization are preserved
  • Configuration is now more flexible and documented

Checklist

  • [x] OpenAPI Generator configuration set up
  • [x] Custom templates created
  • [x] PHP 8.1 support added
  • [x] Documentation updated
  • [x] Existing code structure preserved

lordofweb avatar Nov 23 '24 09:11 lordofweb

Quality Gate Failed Quality Gate failed

Failed conditions
50.2% Duplication on New Code (required ≤ 3%)

See analysis details on SonarQube Cloud

sonarqubecloud[bot] avatar Nov 25 '24 08:11 sonarqubecloud[bot]