Skip to content

Conversation

@lordofweb
Copy link

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

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

Introduced configuration for PHP client generation using OpenAPI Generator.
Updated .gitignore to include .idea directory and created necessary templates and configurations for code generation.
tups added 7 commits November 24, 2024 15:48
Renamed files and updated namespaces from `Brevo\Client\Model` to `Brevo\Client\Models` for improved consistency and organization. Also, adjusted related type references to match the new namespace structure.
Changed the inputSpec path from a URL to a local file reference in config-openapi-generator.yml.
Changed schema types from 'string' to 'integer' for pagination parameters to ensure correct data handling. Refactored the 'Segment' component for cleaner structure and proper reference within 'getSegments'. These adjustments improve overall data consistency and maintainability.
@sonarqubecloud
Copy link

Quality Gate Failed Quality Gate failed

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

See analysis details on SonarQube Cloud

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