A Node.js library and CLI tool that compiles Protocol Buffers IDL (proto files) into JSON Schema definitions. As of version 1.1.1, it supports proto3 syntax and can output JSON or YAML, making it useful for generating OpenAPI/Swagger specs. It can compile all messages from a file or target a specific message with its dependencies. The project appears to be in maintenance mode with no recent updates.
npm install protobuf-jsonschemaNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Compiles a Protocol Buffers IDL file into JSON Schema using the library in Node.js.
Ensure all .proto files use syntax = "proto3";
Use path.resolve() to convert relative paths to absolute before passing.
Manually resolve imports or concatenate all proto files into one before compiling.
Run command with npx: npx protobuf-jsonschema --help
Use path.resolve(__dirname, 'models.proto') to provide absolute path.
Add 'syntax = "proto3";' at the top of your .proto file.
Use require('protobuf-jsonschema') instead of import.No dependency data recorded yet.