diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9162066..959e0c8 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -15,7 +15,7 @@ jobs: - uses: actions/checkout@v3 - name: Install webrpc-gen run: | - curl -o ./webrpc-gen -fLJO https://github.com/webrpc/webrpc/releases/download/v0.25.0/webrpc-gen.linux-amd64 + curl -o ./webrpc-gen -fLJO https://github.com/webrpc/webrpc/releases/download/v0.31.0/webrpc-gen.linux-amd64 chmod +x ./webrpc-gen echo $PWD >> $GITHUB_PATH diff --git a/README.md b/README.md index 9b2fad0..842ef63 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,8 @@ -# webrpc OpenAPI 3.x (Swagger) generator +# webrpc OpenAPI 3.2.0 (Swagger) generator This repo contains the templates used by the [webrpc-gen](https://github.com/webrpc/webrpc) cli to code-generate OpenAPI documentation from webrpc schema. -- [Generate OpenAPI 3.x YAML file](#generate-openapi-3x-yaml-file) +- [Generate OpenAPI 3.2.0 YAML file](#generate-openapi-320-yaml-file) - [Set custom template variables](#set-custom-template-variables) - [Open in Swagger UI](#open-in-swagger-ui) - [Build static HTML documentation with Redocly](#build-static-html-documentation-with-redocly) @@ -12,7 +12,7 @@ This repo contains the templates used by the [webrpc-gen](https://github.com/web - [Authors](#authors) - [License](#license) -# Generate OpenAPI 3.x YAML file +# Generate OpenAPI 3.2.0 YAML file ```bash webrpc-gen -schema=./proto.ridl -target=openapi -out petstore.gen.yaml ``` diff --git a/_examples/openapi.gen.yaml b/_examples/openapi.gen.yaml index 7709156..ad53d34 100644 --- a/_examples/openapi.gen.yaml +++ b/_examples/openapi.gen.yaml @@ -1,9 +1,9 @@ # example v0.0.1 9814b024890e4f9bf0fb6406686c29bcc402b24a # -- -# Code generated by webrpc-gen@v0.25.0 with ../ generator; DO NOT EDIT +# Code generated by webrpc-gen@v0.31.0 with ../ generator; DO NOT EDIT # # webrpc-gen -schema=./proto.ridl -target=../ -out=./openapi.gen.yaml -title=Example webrpc API -apiVersion=v22.11.8 -serverUrl=https://api.example.com -serverDescription=Production -securityAnnotation=@auth -securitySchemes={ 'ApiKeyAuth': { 'type': 'apiKey', 'in': 'header', 'description': 'Project access key for authenticating requests', 'name': 'X-Access-Key' }, 'ServiceAuth': { 'type': 'apiKey', 'in': 'header', 'description': 'Project access key for authenticating requests', 'name': 'X-Access-Key' } } -openapi: 3.0.0 +openapi: 3.2.0 info: title: 'Example webrpc API' version: 'v22.11.8' @@ -189,7 +189,7 @@ components: status: type: number example: 500 - ErrorWebrpcClientDisconnected: + ErrorWebrpcClientAborted: type: object required: - error @@ -199,13 +199,13 @@ components: properties: error: type: string - example: "WebrpcClientDisconnected" + example: "WebrpcClientAborted" code: type: number example: -8 msg: type: string - example: "client disconnected" + example: "request aborted by client" cause: type: string status: @@ -528,7 +528,7 @@ paths: - $ref: '#/components/schemas/ErrorWebrpcBadRoute' - $ref: '#/components/schemas/ErrorWebrpcBadMethod' - $ref: '#/components/schemas/ErrorWebrpcBadRequest' - - $ref: '#/components/schemas/ErrorWebrpcClientDisconnected' + - $ref: '#/components/schemas/ErrorWebrpcClientAborted' - $ref: '#/components/schemas/ErrorWebrpcStreamLost' - $ref: '#/components/schemas/ErrorRateLimited' '5XX': @@ -572,7 +572,7 @@ paths: - $ref: '#/components/schemas/ErrorWebrpcBadRoute' - $ref: '#/components/schemas/ErrorWebrpcBadMethod' - $ref: '#/components/schemas/ErrorWebrpcBadRequest' - - $ref: '#/components/schemas/ErrorWebrpcClientDisconnected' + - $ref: '#/components/schemas/ErrorWebrpcClientAborted' - $ref: '#/components/schemas/ErrorWebrpcStreamLost' - $ref: '#/components/schemas/ErrorRateLimited' '5XX': @@ -617,7 +617,7 @@ paths: - $ref: '#/components/schemas/ErrorWebrpcBadRoute' - $ref: '#/components/schemas/ErrorWebrpcBadMethod' - $ref: '#/components/schemas/ErrorWebrpcBadRequest' - - $ref: '#/components/schemas/ErrorWebrpcClientDisconnected' + - $ref: '#/components/schemas/ErrorWebrpcClientAborted' - $ref: '#/components/schemas/ErrorWebrpcStreamLost' - $ref: '#/components/schemas/ErrorRateLimited' '5XX': @@ -665,7 +665,7 @@ paths: - $ref: '#/components/schemas/ErrorWebrpcBadRoute' - $ref: '#/components/schemas/ErrorWebrpcBadMethod' - $ref: '#/components/schemas/ErrorWebrpcBadRequest' - - $ref: '#/components/schemas/ErrorWebrpcClientDisconnected' + - $ref: '#/components/schemas/ErrorWebrpcClientAborted' - $ref: '#/components/schemas/ErrorWebrpcStreamLost' - $ref: '#/components/schemas/ErrorRateLimited' '5XX': @@ -708,7 +708,7 @@ paths: - $ref: '#/components/schemas/ErrorWebrpcBadRoute' - $ref: '#/components/schemas/ErrorWebrpcBadMethod' - $ref: '#/components/schemas/ErrorWebrpcBadRequest' - - $ref: '#/components/schemas/ErrorWebrpcClientDisconnected' + - $ref: '#/components/schemas/ErrorWebrpcClientAborted' - $ref: '#/components/schemas/ErrorWebrpcStreamLost' - $ref: '#/components/schemas/ErrorRateLimited' '5XX': @@ -749,7 +749,7 @@ paths: - $ref: '#/components/schemas/ErrorWebrpcBadRoute' - $ref: '#/components/schemas/ErrorWebrpcBadMethod' - $ref: '#/components/schemas/ErrorWebrpcBadRequest' - - $ref: '#/components/schemas/ErrorWebrpcClientDisconnected' + - $ref: '#/components/schemas/ErrorWebrpcClientAborted' - $ref: '#/components/schemas/ErrorWebrpcStreamLost' - $ref: '#/components/schemas/ErrorRateLimited' '5XX': @@ -790,7 +790,7 @@ paths: - $ref: '#/components/schemas/ErrorWebrpcBadRoute' - $ref: '#/components/schemas/ErrorWebrpcBadMethod' - $ref: '#/components/schemas/ErrorWebrpcBadRequest' - - $ref: '#/components/schemas/ErrorWebrpcClientDisconnected' + - $ref: '#/components/schemas/ErrorWebrpcClientAborted' - $ref: '#/components/schemas/ErrorWebrpcStreamLost' - $ref: '#/components/schemas/ErrorRateLimited' '5XX': @@ -833,7 +833,7 @@ paths: - $ref: '#/components/schemas/ErrorWebrpcBadRoute' - $ref: '#/components/schemas/ErrorWebrpcBadMethod' - $ref: '#/components/schemas/ErrorWebrpcBadRequest' - - $ref: '#/components/schemas/ErrorWebrpcClientDisconnected' + - $ref: '#/components/schemas/ErrorWebrpcClientAborted' - $ref: '#/components/schemas/ErrorWebrpcStreamLost' - $ref: '#/components/schemas/ErrorRateLimited' '5XX': diff --git a/main.go.tmpl b/main.go.tmpl index 55eca87..ae04946 100644 --- a/main.go.tmpl +++ b/main.go.tmpl @@ -69,7 +69,7 @@ # Code generated by webrpc-gen@{{.WebrpcGenVersion}} with {{.WebrpcTarget}} generator; DO NOT EDIT # # {{.WebrpcGenCommand}} -openapi: 3.0.0 +openapi: 3.2.0 info: title: '{{ get $opts "title" }}' version: '{{ get $opts "apiVersion" }}'