We are thrilled to announce the release of py2proto v2.0.0! This major version update brings significant enhancements to our Protocol Buffer and gRPC generation capabilities, introducing Swagger UI integration for easier API testing and documentation.
What's New
1. Swagger UI Integration
- Automatically generate Swagger JSON files from your Protocol Buffer definitions.
- Built-in Flask server to serve Swagger UI, allowing easy testing and documentation of gRPC services.
- Custom `run_swagger()` method to start the Swagger UI server.
2. Enhanced gRPC Support
- Improved gRPC code generation with better error handling and type checking.
- Simplified service definition using the `relation()` function.
3. Streamlined Proto File Generation
- Refined proto file generation process for cleaner and more consistent output.
- Improved handling of complex types in proto file generation.
4. Customizable Output Directory
- Added `set_output_directory()` method for easy customization of output file locations.
5. Improved Type Mapping
- Enhanced type mapping between Python and Protocol Buffer types.
- Better support for complex types including nested messages and enums.
6. Comprehensive Documentation
- Completely revamped README with detailed usage examples and explanations.
- In-code documentation improvements for better developer experience.
7. Dependency Management
- Updated dependencies to ensure compatibility with the latest gRPC and Protobuf versions.
- Added Flask as a new dependency for Swagger UI support.
Breaking Changes
- The `run_flask()` method has been renamed to `run_swagger()` to better reflect its purpose.
- Some internal APIs have been modified, which may affect users who were directly interacting with these components.
Upgrading from 1.x
To upgrade from version 1.x, please ensure you update your code to use `run_swagger()` instead of `run_flask()`. Also, review your Proto class definitions to ensure they comply with the new type mapping system.
Documentation
For detailed information on how to use the new features, please refer to our updated [README.md](https://github.com/ProdByGodfather/py2proto/blob/master/README.md) file.
We're excited about these new features and improvements, and we hope they enhance your development experience with py2proto. As always, we welcome your feedback and contributions!
Happy coding!
The py2proto Team