GithubHelp home page GithubHelp logo

pseudomuto / protoc-gen-twagger Goto Github PK

View Code? Open in Web Editor NEW
10.0 2.0 1.0 255 KB

A Protobuf plugin that generates Swagger docs for Twirp Services

License: MIT License

Makefile 9.59% Go 84.50% Shell 5.91%
protobuf twirp documentation swagger

protoc-gen-twagger's Introduction

protoc-gen-twagger

Travis Build Status codecov GoDoc Go Report Card

A protobuf plugin that generates Swagger docs for your Twirp services.

Lots of assumptions being made at the moment...use with caution.

For a demo, clone the repo and run make setup swagger. Then open your browser to http://localhost:8080 and browse around.

Running the Plugin

You'll need to install the binary.

go get -u github.com/pseudomuto/protoc-gen-twagger/cmd/protoc-gen-twagger

Even better, if you use a tool like retool you can get a specific version. For example:

retool add github.com/pseudomuto/protoc-gen-twagger/cmd/protoc-gen-twagger <branch|tag>

Once installed you can invoke it with protoc like so:

protoc -I. -I$(GOPATH)src --twagger_out=. input_proto1.proto input_proto2.proto

This will generate swagger.json in the current directory.

Using Docker

Alternatively you can run this with docker. There's a public image pseudomuto/protoc-gen-twagger which can be used to run the plugin.

docker run --rm \
  -v $(pwd)/protos:/in:ro \
  -v $(pwd):/out:rw \
  pseudomuto/protoc-gen-twagger input_proto1.proto input_proto2.proto

Input paths are relative from /in inside the container. Take a look at the run-docker make task for a working example.

protoc-gen-twagger's People

Contributors

pseudomuto avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

pinkdiamond1

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.