Gnostic is a command-line tool and Go library developed by Google for converting OpenAPI specifications (in JSON or YAML) to and from Protocol Buffer (protobuf) representations. It allows developers to handle OpenAPI documents in a strongly typed, language-neutral, and extensible way by generating structured data models that can be used across different programming languages supported by protobuf. Using these protobuf models, developers can safely parse, validate, and manipulate OpenAPI specifications, resolve dependencies, and export results as JSON, YAML, or binary files. Gnostic also provides a plugin interface similar to protoc, enabling integration with external API tooling and the generation of additional artifacts, such as annotated protobuf APIs, Go clients, and vocabulary summaries. It supports multiple OpenAPI versions (v2, v3) and Google Discovery Documents.
Features
- Converts OpenAPI JSON/YAML to Protocol Buffer and back
- Provides type-safe OpenAPI data models for Go and other languages
- Plugin system for extending functionality (e.g., gRPC annotations, Go client generation)
- Resolves internal dependencies and validates OpenAPI structure
- Supports OpenAPI v2, v3, and Google Discovery documents
- Integration-ready for Go environments and protobuf toolchains