gogo / grpc-example

An example of using Go gRPC and tools from the greater gRPC ecosystem together with the GoGo Protobuf Project.
Other
453 stars 87 forks source link

How is the OpenAPI UI generated? #14

Closed yurishkuro closed 6 years ago

yurishkuro commented 6 years ago

I see a number of static assets added in https://github.com/gogo/grpc-example/commit/a6e1cf36babfecf2dd04238aee48c736445036c7, but no indication where they came from. The option --swagger_out=third_party/OpenAPI/ to protoc only generates the JSON file. If I want to serve swagger UI from my application, how would I go about generating them? I don't want to just copy them from this repo.

I'm happy to create a PR with example/explanation if you point me in the right direction.

johanbrandhorst commented 6 years ago

Hi!

The request/reply elements are all dynamically generated from the generated swagger.json file by swagger-ui.js. The contents of the third_party/OpenAPI folder are copied directly from the dist folder of the OpenAPI-UI project.

You're welcome to create a PR to clarify this in the README if you think it's unclear and should be added.