{"id":21403,"library":"grpc-gateway-protoc-gen-openapiv2","title":"gRPC Gateway OpenAPI v2 Protoc Generator","description":"Provides the missing pieces for gRPC Gateway, specifically the protoc-gen-openapiv2 plugin for generating OpenAPI v2 specs from gRPC protobuf definitions. Current version 0.1.0, requires Python >=3.6, early development.","status":"active","version":"0.1.0","language":"python","source_language":"en","source_url":"https://github.com/hack-edu/py_protoc_gen_openapiv2","tags":["grpc","gateway","openapi","protobuf","plugin"],"install":[{"cmd":"pip install grpc-gateway-protoc-gen-openapiv2","lang":"bash","label":"pip install"}],"dependencies":[{"reason":"Required for protobuf definitions","package":"protobuf","optional":false},{"reason":"Required for gRPC protoc plugin support","package":"grpcio-tools","optional":true}],"imports":[{"note":"Package prefix required","wrong":"import protoc_gen_openapiv2","symbol":"plugin","correct":"import grpc_gateway_protoc_gen_openapiv2.plugin"},{"note":"Old incorrect import path","wrong":"from protoc_gen_openapiv2 import generate_openapi","symbol":"generate_openapi","correct":"from grpc_gateway_protoc_gen_openapiv2.plugin import generate_openapi"}],"quickstart":{"code":"import os\nfrom grpc_gateway_protoc_gen_openapiv2.plugin import generate_openapi\n\n# Example usage - replace with actual proto file path\nproto_file = \"api.proto\"\noutput_dir = \"./openapi\"\n\n# Generate OpenAPI spec\n# generate_openapi(proto_file, output_dir)  # uncomment when ready\nprint(\"Quickstart placeholder - see README\")\n","lang":"python","description":"Basic import and placeholder usage of the plugin."},"warnings":[{"fix":"Monitor repository for updates and pin version.","message":"Package name is under development; import paths may change without major version bump.","severity":"breaking","affected_versions":"0.1.0"},{"fix":"Ensure protoc and protoc-gen-openapiv2 are in PATH.","message":"The plugin is a Python wrapper; protoc itself and protoc-gen-openapiv2 binary must be installed separately.","severity":"gotcha","affected_versions":">=0.1.0"}],"env_vars":null,"last_verified":"2026-04-27T00:00:00.000Z","next_check":"2026-07-26T00:00:00.000Z","problems":[{"fix":"Use: import grpc_gateway_protoc_gen_openapiv2.plugin","cause":"Incorrect import path (missing package prefix).","error":"ModuleNotFoundError: No module named 'protoc_gen_openapiv2'"},{"fix":"Install protoc-gen-openapiv2 from grpc-gateway repository.","cause":"External binary not installed.","error":"protoc: error: plugin protoc-gen-openapiv2 not found"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}