{"id":13461415,"url":"https://github.com/google/gnostic","last_synced_at":"2025-12-14T20:33:56.682Z","repository":{"id":39907498,"uuid":"73847381","full_name":"google/gnostic","owner":"google","description":"A compiler for APIs described by the OpenAPI Specification with plugins for code generation and other API support tasks.","archived":false,"fork":false,"pushed_at":"2024-06-27T12:59:11.000Z","size":6206,"stargazers_count":2186,"open_issues_count":99,"forks_count":258,"subscribers_count":37,"default_branch":"main","last_synced_at":"2025-05-03T06:46:43.318Z","etag":null,"topics":["apis","code-generation","gnostic","linters","openapi","openapi3","protocol-buffers"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/google.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-11-15T19:21:53.000Z","updated_at":"2025-04-29T11:58:45.000Z","dependencies_parsed_at":"2024-01-06T14:05:56.978Z","dependency_job_id":"f5f4d5f9-b0d4-4c53-bdc8-055a9e166a5f","html_url":"https://github.com/google/gnostic","commit_stats":{"total_commits":642,"total_committers":45,"mean_commits":"14.266666666666667","dds":0.2320872274143302,"last_synced_commit":"ad271d568b713ad381ad6751cd8b950eade78d98"},"previous_names":["googleapis/gnostic","googleapis/openapi-compiler"],"tags_count":45,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/google%2Fgnostic","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/google%2Fgnostic/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/google%2Fgnostic/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/google%2Fgnostic/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/google","download_url":"https://codeload.github.com/google/gnostic/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253745197,"owners_count":21957320,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["apis","code-generation","gnostic","linters","openapi","openapi3","protocol-buffers"],"created_at":"2024-07-31T11:00:38.392Z","updated_at":"2025-12-14T20:33:56.616Z","avatar_url":"https://github.com/google.png","language":"Go","funding_links":[],"categories":["Go","others"],"sub_categories":[],"readme":"[![Go Actions Status](https://github.com/google/gnostic/workflows/Go/badge.svg)](https://github.com/google/gnostic/actions)\n\n# ⨁ gnostic\n\nThis repository contains a Go command line tool which converts JSON and YAML\n[OpenAPI](https://github.com/OAI/OpenAPI-Specification) descriptions to and\nfrom equivalent Protocol Buffer representations.\n\n[Protocol Buffers](https://developers.google.com/protocol-buffers/) provide a\nlanguage-neutral, platform-neutral, extensible mechanism for serializing\nstructured data. **gnostic**'s Protocol Buffer models for the OpenAPI\nSpecification can be used to generate code that includes data structures with\nexplicit fields for the elements of an OpenAPI description. This makes it\npossible for developers to work with OpenAPI descriptions in type-safe ways,\nwhich is particularly useful in strongly-typed languages like Go and\n[Dart](https://dart.dev/).\n\n**gnostic** reads OpenAPI descriptions into these generated data structures,\nreports errors, resolves internal dependencies, and writes the results in a\nbinary form that can be used in any language that is supported by the Protocol\nBuffer tools. A plugin interface simplifies integration with API tools written\nin a variety of different languages, and when necessary, Protocol Buffer\nOpenAPI descriptions can be reexported as JSON or YAML.\n\n**gnostic** compilation code and OpenAPI Protocol Buffer models are\nautomatically generated from an\n[OpenAPI JSON Schema](https://github.com/OAI/OpenAPI-Specification/blob/master/schemas/v2.0/schema.json).\nSource code for the generator is in the [generate-gnostic](generate-gnostic)\ndirectory.\n\n## Related Repositories\n\n[google/gnostic-models](https://github.com/google/gnostic-models) contains a\nlightweight distribution of the protobuf models generated by this project.\nWhere a low-dependency integration of just these models is needed, Go projects\ncan import packages from `gnostic-models` instead of `gnostic`.\n\n[google/gnostic-grpc](https://github.com/google/gnostic-grpc) contains a\ngnostic plugin that can generate an annotated Protocol Buffer description of an\nAPI that, when transcoded, produces an API that conforms to a specified OpenAPI\ndocument. To go from protobuf to OpenAPI, see the\n[protoc-gen-openapi](cmd/protoc-gen-openapi) tool in this project.\n\n[google/gnostic-go-generator](https://github.com/google/gnostic-go-generator)\ncontains an experimental gnostic plugin that generates a Go client for an API\ndescribed by a specified OpenAPI document.\n\n## Disclaimer\n\nFeedback and contributions are welcome! Until there is a 1.0 release, please\nconsider this prerelease software and work in progress. To ensure stable\nbuilds, we request that dependent projects always refer to tagged releases of\n**gnostic**.\n\n## Requirements\n\n**gnostic** can be run in any environment that supports [Go](http://golang.org)\nand the\n[Protocol Buffer Compiler](https://github.com/protocolbuffers/protobuf).\n\n## Installation and Getting Started\n\nThe following instructions are for installing **gnostic** using\n[Go modules](https://blog.golang.org/using-go-modules), supported by Go 1.11\nand later.\n\n1.  Get this package by downloading it with `git clone`.\n\n        git clone https://github.com/google/gnostic\n        cd gnostic\n\n2.  Verify that you have a local installation of `protoc`. You can get `protoc`\n    [here](https://github.com/protocolbuffers/protobuf).\n\n3.  Build **gnostic** with `make`. This uses\n    [go generate](https://blog.golang.org/generate) to build support code\n    including code generated by `protoc` and the Go `protoc` plugin, which is\n    automatically downloaded from\n    [github.com/golang/protobuf](https://github.com/golang/protobuf) by the\n    [COMPILE-PROTOS.sh](COMPILE-PROTOS.sh) script. This also builds all plugins\n    and associated tools in this repo.\n\n4.  Verify **gnostic** with `make test`. These tests are run by **gnostic**'s\n    continuous integration, so you should expect them to pass for all release\n    versions.\n\n5.  Run **gnostic**. This sample invocation creates a file in the current\n    directory named `petstore.pb` that contains a binary Protocol Buffer\n    description of a sample API.\n\n            gnostic --pb-out=. examples/v2.0/json/petstore.json\n\n6.  You can also compile files that you specify with a URL. Here's another way\n    to compile the previous example. This time we're creating `petstore.text`,\n    which contains a textual representation of the Protocol Buffer description.\n    This is mainly for use in testing and debugging.\n\n            gnostic --text-out=petstore.text https://raw.githubusercontent.com/google/gnostic/master/examples/v2.0/json/petstore.json\n\n7.  For a sample application, see apps/report. This reads a binary Protocol\n    Buffer encoding created by **gnostic**.\n\n        go install ./apps/report ## automatically installed by the top-level Makefile\n        report petstore.pb\n\n8.  **gnostic** also supports plugins. **gnostic**'s plugin interface is\n    modeled on `protoc`'s\n    [plugin.proto](https://github.com/protocolbuffers/protobuf/blob/master/src/google/protobuf/compiler/plugin.proto)\n    and is described in [plugins/plugin.proto](plugins/plugin.proto). Several\n    plugins are implemented in the `plugins` directory. Others, like\n    [gnostic-grpc](https://github.com/google/gnostic-grpc) and\n    [gnostic-go-generator](https://github.com/google/gnostic-go-generator),\n    are published in their own repositories. One such plugin is\n    [gnostic-vocabulary](plugins/gnostic-vocabulary), which produces a summary\n    of the word usage in an APIs interfaces. You can run `gnostic-vocabulary`\n    with the following:\n\n            gnostic examples/v2.0/json/petstore.json --vocabulary_out=.\n\n    This will produce files named `vocabulary.pb` and `vocabulary.json` in\n    `examples/v2.0/json`. For the format of `vocabulary.pb`, see\n    [metrics/vocabulary.proto](metrics/vocabulary.proto).\n\n9.  [Optional] A large part of **gnostic** is automatically-generated by the\n    [generate-gnostic](generate-gnostic) tool. This uses JSON schemas to\n    generate Protocol Buffer language files that describe supported API\n    specification formats and Go-language files of code that will read JSON or\n    YAML API descriptions into the generated protocol buffer models.\n    Pre-generated versions of these files are checked into the\n    [openapiv2](openapiv2), [openapiv3](openapiv3), and [discovery](discovery)\n    directories. You can regenerate this code with the following:\n\n        go install ./generate-gnostic\n        generate-gnostic --v2\n        generate-gnostic --v3\n        generate-gnostic --discovery\n\n## Copyright\n\nCopyright 2017-2020, Google LLC.\n\n## License\n\nReleased under the Apache 2.0 license.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgoogle%2Fgnostic","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgoogle%2Fgnostic","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgoogle%2Fgnostic/lists"}