All Projects → google → Gnostic

google / Gnostic

Licence: apache-2.0
A compiler for APIs described by the OpenAPI Specification with plugins for code generation and other API support tasks.

Programming Languages

go
31211 projects - #10 most used programming language

Projects that are alternatives of or similar to Gnostic

php-json-schema-model-generator
Creates (immutable) PHP model classes from JSON-Schema files including all validation rules as PHP code
Stars: ✭ 36 (-95.86%)
Mutual labels:  openapi, code-generation, openapi3
Quenya
Quenya is a framework to build high-quality REST API applications based on extended OpenAPI spec
Stars: ✭ 121 (-86.09%)
Mutual labels:  openapi, openapi3, code-generation
Apispec
A pluggable API specification generator. Currently supports the OpenAPI Specification (f.k.a. the Swagger specification)..
Stars: ✭ 831 (-4.48%)
Mutual labels:  openapi, openapi3
Create Openapi Repo
🤖 Generator for GH repo to help you manage the OpenAPI definition lifecycle
Stars: ✭ 513 (-41.03%)
Mutual labels:  openapi, openapi3
Generator Express No Stress
🚂 A Yeoman generator for Express.js based 12-factor apps and apis
Stars: ✭ 534 (-38.62%)
Mutual labels:  openapi, openapi3
Openapi Gui
GUI / visual editor for creating and editing OpenAPI / Swagger definitions
Stars: ✭ 891 (+2.41%)
Mutual labels:  openapi, openapi3
Swagger Parser
Swagger Spec to Java POJOs
Stars: ✭ 468 (-46.21%)
Mutual labels:  openapi, openapi3
Apisprout
Lightweight, blazing fast, cross-platform OpenAPI 3 mock server with validation
Stars: ✭ 519 (-40.34%)
Mutual labels:  openapi, openapi3
Goa
Design-based APIs and microservices in Go
Stars: ✭ 4,493 (+416.44%)
Mutual labels:  code-generation, openapi
Kin Openapi
OpenAPI 3.0 implementation for Go (parsing, converting, validation, and more)
Stars: ✭ 776 (-10.8%)
Mutual labels:  openapi, openapi3
Optic
Optic documents and tests your API as you build it
Stars: ✭ 760 (-12.64%)
Mutual labels:  openapi, apis
Swagger Core
Examples and server integrations for generating the Swagger API Specification, which enables easy access to your REST API
Stars: ✭ 6,898 (+692.87%)
Mutual labels:  openapi, openapi3
Studio
The modern editor for API Design and Technical Writing.
Stars: ✭ 459 (-47.24%)
Mutual labels:  openapi, openapi3
Openapi Specification
The OpenAPI Specification Repository
Stars: ✭ 22,603 (+2498.05%)
Mutual labels:  openapi, apis
Awesome Openapi3
😎 A list of awesome projects related to OpenAPI 3.0.x, curated by the community
Stars: ✭ 469 (-46.09%)
Mutual labels:  openapi, openapi3
Swagger Ui
Swagger UI is a collection of HTML, JavaScript, and CSS assets that dynamically generate beautiful documentation from a Swagger-compliant API.
Stars: ✭ 21,279 (+2345.86%)
Mutual labels:  openapi, openapi3
Oas Kit
Convert Swagger 2.0 definitions to OpenAPI 3.0 and resolve/validate/lint
Stars: ✭ 516 (-40.69%)
Mutual labels:  openapi, openapi3
Oapi Codegen
Generate Go client and server boilerplate from OpenAPI 3 specifications
Stars: ✭ 806 (-7.36%)
Mutual labels:  openapi, openapi3
Kroto Plus
gRPC Kotlin Coroutines, Protobuf DSL, Scripting for Protoc
Stars: ✭ 400 (-54.02%)
Mutual labels:  protocol-buffers, code-generation
Express Openapi Validator
🦋 Auto-validates api requests, responses, and securities using ExpressJS and an OpenAPI 3.x specification
Stars: ✭ 436 (-49.89%)
Mutual labels:  openapi, openapi3

Go Actions Status

⨁ gnostic

This repository contains a Go command line tool which converts JSON and YAML OpenAPI descriptions to and from equivalent Protocol Buffer representations.

Protocol Buffers provide a language-neutral, platform-neutral, extensible mechanism for serializing structured data. gnostic's Protocol Buffer models for the OpenAPI Specification can be used to generate code that includes data structures with explicit fields for the elements of an OpenAPI description. This makes it possible for developers to work with OpenAPI descriptions in type-safe ways, which is particularly useful in strongly-typed languages like Go and Dart.

gnostic reads OpenAPI descriptions into these generated data structures, reports errors, resolves internal dependencies, and writes the results in a binary form that can be used in any language that is supported by the Protocol Buffer tools. A plugin interface simplifies integration with API tools written in a variety of different languages, and when necessary, Protocol Buffer OpenAPI descriptions can be reexported as JSON or YAML.

gnostic compilation code and OpenAPI Protocol Buffer models are automatically generated from an OpenAPI JSON Schema. Source code for the generator is in the generate-gnostic directory.

Disclaimer

Feedback and contributions are welcome! Until there is a 1.0 release, please consider this prerelease software and work in progress. To ensure stable builds, we request that dependent projects always refer to tagged releases of gnostic.

Requirements

gnostic can be run in any environment that supports Go and the Protocol Buffer Compiler.

Installation and Getting Started

The following instructions are for installing gnostic using Go modules, supported by Go 1.11 and later.

  1. Get this package by downloading it with git clone.

    git clone https://github.com/googleapis/gnostic
    cd gnostic
    
  2. Verify that you have a local installation of protoc. You can get protoc here.

  3. Build gnostic with make. This uses go generate to build support code including code generated by protoc and the Go protoc plugin, which is automatically downloaded from github.com/golang/protobuf by the COMPILE-PROTOS.sh script. This also builds all plugins and associated tools in this repo.

  4. Verify gnostic with make test. These tests are run by gnostic's continuous integration, so you should expect them to pass for all release versions.

  5. Run gnostic. This sample invocation creates a file in the current directory named petstore.pb that contains a binary Protocol Buffer description of a sample API.

        gnostic --pb-out=. examples/v2.0/json/petstore.json
    
  6. You can also compile files that you specify with a URL. Here's another way to compile the previous example. This time we're creating petstore.text, which contains a textual representation of the Protocol Buffer description. This is mainly for use in testing and debugging.

        gnostic --text-out=petstore.text https://raw.githubusercontent.com/googleapis/gnostic/master/examples/v2.0/json/petstore.json
    
  7. For a sample application, see apps/report. This reads a binary Protocol Buffer encoding created by gnostic.

    go install ./apps/report ## automatically installed by the top-level Makefile
    report petstore.pb
    
  8. gnostic also supports plugins. gnostic's plugin interface is modeled on protoc's plugin.proto and is described in plugins/plugin.proto. Several plugins are implemented in the plugins directory. Others, like gnostic-grpc and gnostic-go-generator, are published in their own repositories. One such plugin is gnostic-vocabulary, which produces a summary of the word usage in an APIs interfaces. You can run gnostic-vocabulary with the following:

        gnostic examples/v2.0/json/petstore.json --vocabulary_out=.
    

    This will produce files named vocabulary.pb and vocabulary.json in examples/v2.0/json. For the format of vocabulary.pb, see metrics/vocabulary.proto.

  9. [Optional] A large part of gnostic is automatically-generated by the generate-gnostic tool. This uses JSON schemas to generate Protocol Buffer language files that describe supported API specification formats and Go-language files of code that will read JSON or YAML API descriptions into the generated protocol buffer models. Pre-generated versions of these files are checked into the openapiv2, openapiv3, and discovery directories. You can regenerate this code with the following:

    go install ./generate-gnostic
    generate-gnostic --v2
    generate-gnostic --v3
    generate-gnostic --discovery
    

Copyright

Copyright 2017-2020, Google LLC.

License

Released under the Apache 2.0 license.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].