brevo-php
brevo-php copied to clipboard
Update SDK generator to OpenAPI Generator
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:
-
Generated code modernization
- Full PHP 8.1 support
- Better strict type handling
- Cleaner and better documented code
-
Improved maintenance
- Centralized configuration in
config-openapi-generator.yml - Custom templates for better generated code control
- Easier to update with future API versions
- Centralized configuration in
-
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
