All Projects → grpc-swagger → Grpc Swagger

grpc-swagger / Grpc Swagger

Licence: mit
Debugging gRPC application with swagger-ui.

Programming Languages

java
68154 projects - #9 most used programming language

Projects that are alternatives of or similar to Grpc Swagger

Graphql Mesh
GraphQL Mesh — Query anything, run anywhere
Stars: ✭ 2,114 (+773.55%)
Mutual labels:  swagger, grpc, openapi
Grpc Gateway
The gRPC-Gateway is a plugin of the Google protocol buffers compiler protoc. It reads protobuf service definitions and generates a reverse-proxy server which translates a RESTful HTTP API into gRPC. This server is generated according to the google.api.http annotations in your service definitions.
Stars: ✭ 12,223 (+4950.83%)
Mutual labels:  swagger, grpc, openapi
Mockoon
Mockoon is the easiest and quickest way to run mock APIs locally. No remote deployment, no account required, open source.
Stars: ✭ 3,448 (+1324.79%)
Mutual labels:  swagger, openapi
Gradle Swagger Generator Plugin
Gradle plugin for OpenAPI YAML validation, code generation and API document publishing
Stars: ✭ 197 (-18.6%)
Mutual labels:  swagger, openapi
Swaggerprovider
F# generative Type Provider for Swagger
Stars: ✭ 201 (-16.94%)
Mutual labels:  swagger, openapi
Flasgger
Easy OpenAPI specs and Swagger UI for your Flask API
Stars: ✭ 2,825 (+1067.36%)
Mutual labels:  swagger, openapi
Drf Yasg
Automated generation of real Swagger/OpenAPI 2.0 schemas from Django REST Framework code.
Stars: ✭ 2,523 (+942.56%)
Mutual labels:  swagger, openapi
Openapi Codegen
OpenAPI 3.0 CodeGen plus Node.js minus the Java and emojis
Stars: ✭ 224 (-7.44%)
Mutual labels:  swagger, openapi
Proteus
Lean, mean, and incredibly fast JVM framework for web and microservice development.
Stars: ✭ 178 (-26.45%)
Mutual labels:  swagger, openapi
Spot
Spot is a concise, developer-friendly way to describe your API contract.
Stars: ✭ 230 (-4.96%)
Mutual labels:  swagger, openapi
Redoc
📘 OpenAPI/Swagger-generated API Reference Documentation
Stars: ✭ 15,935 (+6484.71%)
Mutual labels:  swagger, openapi
Openapi Diff
Utility for comparing two OpenAPI specifications.
Stars: ✭ 208 (-14.05%)
Mutual labels:  swagger, openapi
Swagger Node Codegen
An OpenAPI 3.x/Swagger 2 code generator for Node.js
Stars: ✭ 189 (-21.9%)
Mutual labels:  swagger, openapi
Imposter
Scriptable, multipurpose mock server.
Stars: ✭ 187 (-22.73%)
Mutual labels:  swagger, openapi
Hapi Openapi
Build design-driven apis with OpenAPI (formerly swagger) 2.0 and hapi.
Stars: ✭ 196 (-19.01%)
Mutual labels:  swagger, openapi
Magiconion
Unified Realtime/API framework for .NET platform and Unity.
Stars: ✭ 2,505 (+935.12%)
Mutual labels:  swagger, grpc
Openapi Mock
OpenAPI mock server with random data generation
Stars: ✭ 202 (-16.53%)
Mutual labels:  swagger, openapi
Openapi Backend
Build, Validate, Route, Authenticate and Mock using OpenAPI
Stars: ✭ 216 (-10.74%)
Mutual labels:  swagger, openapi
Sway
A library that simplifies OpenAPI (fka Swagger) integrations/tooling.
Stars: ✭ 175 (-27.69%)
Mutual labels:  swagger, openapi
Esi Issues
Issue tracking and feature requests for ESI
Stars: ✭ 176 (-27.27%)
Mutual labels:  swagger, openapi

gRPC-swagger

Build Status Coverage Status GitHub license

中文文档

What is gRPC-swagger

gRPC-swagger is a gRPC debuggling tool developed based on gRPC reflection. It can be used to list and call gRPC methods using swagger-ui conveniently. As gRPC-swagger is based on gRPC reflection, you only need to enable reflection feature when starting the service and no need modifying proto files and related code implementations.

Feature List

  • Easy to use, just need enable reflection when starting the service, without modifying protos and related implementations.
  • Integrated with swagger-ui, you can see the definitions of gRPC methods and parameters conveniently.
  • Simple to call gRPC method.

Screenshots

Live Demo

demo

Build and Run

Use released jar

wget https://github.com/grpc-swagger/grpc-swagger/releases/latest/download/grpc-swagger.jar 
java -jar grpc-swagger.jar

Build from source

mvn clean package
java -jar grpc-swagger-web/target/grpc-swagger.jar

By default it will start at port 8080, use --server.port=yourport if you want to use another port.

java -jar grpc-swagger-web/target/grpc-swagger.jar --server.port=8888

Other parameters

  • --enable.list.service=(true/false) - Weather enable list registered services through listServices api.
  • --service.expired.seconds=expiredSeconds - If expiredSeconds is greater than 0, the registered service will be expired after expiredSeconds if no access.

How to use it

  1. Run gRPC-swagger, referring to Build and Run
  2. Enable reflection when staring service. Below is a java example:
    add dependency to pom.xml:
    <dependency>
        <groupId>io.grpc</groupId>
        <artifactId>grpc-services</artifactId>
        <version>${grpc.version}</version>
    </dependency>
    
    enable reflection:
    Server server = ServerBuilder.forPort(SERVER_PORT)
        .addService(new HelloServiceImpl())
        .addService(ProtoReflectionService.newInstance())
        .build()
        .start();
    
  3. Register endpoint. Open this page, input necessary message and click register button, gRPC-swagger will automatically scan available services and return successful registered services when finished. You can click service link jump to ui page.

  1. Use swagger-ui to see gRPC services.
  2. Click Try it out button to have a test on the gRPC method.

Parameters

  • Request:the request data of gRPC,JSON format.
  • headers:metadata(header)passing to gRPC server,JSON format. Key represent header name,value represent header value.

API

Register Endpoint

url:/register

parameters:

  • host - required, e.g. localhost
  • port - required, e.g. 12347

return example:

{
    "code": 1,
    "data": [
        {
            "service": "io.grpc.grpcswagger.showcase.HelloService",
            "endPoint": "localhost:12347"
        }
    ]
}

Services List

url: /listServices

return example:

{
    "code": 1,
    "data": [
        {
            "service": "io.grpc.grpcswagger.showcase.HelloService",
            "endPoint": "localhost:12347"
        }
    ]
}

Call gRPC Method

url: /{rawFullMethodName}

parameters:

  • rawFullMethodName - the full gRPC method name,e.g. io.grpc.grpcswagger.showcase.HelloService.GetUser
  • payload - gRPC method parameters,JSON format。 You can use endpoint parameter to specify the calling endpoint.

Swagger API

url: /v2/api-docs

return data used by swagger-ui

parameters:

  • service - full service name,e.g. io.grpc.grpcswagger.showcase.HelloService.

Acknowledgment

Thanks to the polyglot project,The reflection related logic in our project is modified on polygolt.

Contribute

Feel free to open an issue or pull request. We will appreciate it!

FAQ

License

MIT 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].