This repo contains the templates used by the webrpc-gen cli to code-generate OpenAPI documentation from webrpc schema.
- Generate OpenAPI 3.x YAML file
- Open in Swagger UI
- Build static HTML documentation with Redocly
- Generate client/docs via OpenAPI generator
- Authors
- License
webrpc-gen -schema=./proto.ridl -target=openapi -out petstore.gen.yaml
or
webrpc-gen -schema=./proto.ridl -target=github.com/webrpc/[email protected] -out petstore.gen.yaml
Change any of the following default values by passing -option="Value"
CLI flag to webrpc-gen.
webrpc-gen -option | Default value | Example value |
---|---|---|
-title |
{Services[0].Name} API |
"Example API" |
-apiVersion |
"" |
v22.10.25 |
-serverUrl |
"" |
https://api.example.com |
-serverDescription |
"" |
"Staging API" |
Example:
webrpc-gen -schema=./petstore.ridl -target=github.com/webrpc/[email protected] -out petstore.gen.yaml -title="Example webrpc API" -apiVersion="v22.11.8" -serverUrl=https://api.example.com -serverDescription="Production"
Open generated documentation in Swagger editor:
docker run -p 8088:8080 -v $(pwd):/app -e SWAGGER_JSON=/app/petstore.gen.yaml swaggerapi/swagger-ui
Or in Swagger editor:
docker run -p 8088:8080 -v $(pwd):/app -e SWAGGER_FILE=/app/petstore.gen.yaml swaggerapi/swagger-editor
And go to http://localhost:8088
You can use Redocly tool to build static HTML documentation. Customize the look and feel through theming options.
Example:
docker run --rm -v $(pwd):/app -w /app ghcr.io/redocly/redoc/cli build petstore.gen.yaml
You can use OpenAPI generator to generate API clients in different languages or documentation from the generated OpenAPI yaml file.
docker run --rm -v "${PWD}:/app" openapitools/openapi-generator-cli:v6.2.1 generate -i /app/openapi.gen.yaml -g csharp-netcore -p targetFramework=net6.0 -o /app/csharp-net-7.0
- ada
- ada-server
- android
- apache2
- apex
- asciidoc
- aspnetcore
- avro-schema
- bash
- crystal
- c
- clojure
- cwiki
- cpp-qt-client
- cpp-qt-qhttpengine-server
- cpp-pistache-server
- cpp-restbed-server
- cpp-restbed-server-deprecated
- cpp-restsdk
- cpp-tiny
- cpp-tizen
- cpp-ue4
- csharp
- csharp-netcore
- csharp-dotnet2
- csharp-netcore-functions
- dart
- dart-dio
- eiffel
- elixir
- elm
- erlang-client
- erlang-proper
- erlang-server
- fsharp-functions
- fsharp-giraffe-server
- go
- go-echo-server
- go-server
- go-gin-server
- graphql-schema
- graphql-nodejs-express-server
- groovy
- kotlin
- kotlin-server
- kotlin-spring
- kotlin-vertx
- ktorm-schema
- haskell-http-client
- haskell
- haskell-yesod
- java
- jaxrs-cxf-client
- java-helidon-client
- java-helidon-server
- java-inflector
- java-micronaut-client
- java-micronaut-server
- java-msf4j
- java-pkmst
- java-play-framework
- java-undertow-server
- java-vertx
- java-vertx-web
- java-camel
- jaxrs-cxf
- jaxrs-cxf-extended
- jaxrs-cxf-cdi
- jaxrs-jersey
- jaxrs-resteasy
- jaxrs-resteasy-eap
- jaxrs-spec
- javascript
- javascript-apollo-deprecated
- javascript-flowtyped
- javascript-closure-angular
- jmeter
- k6
- lua
- markdown
- mysql-schema
- nim
- nodejs-express-server
- objc
- ocaml
- openapi
- openapi-yaml
- plantuml
- perl
- php
- php-laravel
- php-lumen
- php-slim-deprecated
- php-slim4
- php-symfony
- php-mezzio-ph
- php-dt
- powershell
- protobuf-schema
- python-legacy
- python
- python-fastapi
- python-prior
- python-flask
- python-aiohttp
- python-blueplanet
- r
- ruby
- ruby-on-rails
- ruby-sinatra
- rust
- rust-server
- scalatra
- scala-akka
- scala-akka-http-server
- scala-finch
- scala-httpclient-deprecated
- scala-gatling
- scala-lagom-server
- scala-play-server
- scala-sttp
- scalaz
- spring
- dynamic-html
- html
- html2
- swift5
- typescript
- typescript-angular
- typescript-aurelia
- typescript-axios
- typescript-fetch
- typescript-inversify
- typescript-jquery
- typescript-nestjs
- typescript-node
- typescript-redux-query
- typescript-rxjs
- wsdl-schema