{"library":"protoc-gen-swagger","title":"protoc-gen-swagger","description":"A Python protoc plugin that generates Swagger/OpenAPI specifications from annotated protobuf files. Currently at version 0.1.0, released as a minimal early release. No regular release cadence established yet.","language":"python","status":"active","last_verified":"Fri May 01","install":{"commands":["pip install protoc-gen-swagger"],"cli":{"name":"protoc-gen-swagger","version":"sh: 1: protoc-gen-swagger: not found"}},"imports":["import protoc_gen_swagger"],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"# Generate swagger.json from a .proto file using the protoc plugin\n# Make sure you have protoc installed, then run:\n# protoc --swagger_out=. --proto_path=protos protos/your_service.proto\n\nimport subprocess\nimport os\n\nproto_file = \"your_service.proto\"\nproto_path = \"protos\"\noutput_dir = \".\"\n\ncmd = [\n    \"protoc\",\n    f\"--swagger_out={output_dir}\",\n    f\"--proto_path={proto_path}\",\n    proto_file\n]\nsubprocess.run(cmd, check=True)\nprint(\"Generated swagger.json\")\n","lang":"python","description":"Invoke protoc with the swagger plugin (requires protoc-gen-swagger installed and in PATH).","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":null}