Skip to content

Commit 1ddac31

Browse files
authored
Update to OpenAPI 3.2.0 (#26)
* Update to OpenAPI 3.2.0 * Update webrpc in CI
1 parent 04885ae commit 1ddac31

4 files changed

Lines changed: 18 additions & 18 deletions

File tree

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
- uses: actions/checkout@v3
1616
- name: Install webrpc-gen
1717
run: |
18-
curl -o ./webrpc-gen -fLJO https://github.com/webrpc/webrpc/releases/download/v0.25.0/webrpc-gen.linux-amd64
18+
curl -o ./webrpc-gen -fLJO https://github.com/webrpc/webrpc/releases/download/v0.31.0/webrpc-gen.linux-amd64
1919
chmod +x ./webrpc-gen
2020
echo $PWD >> $GITHUB_PATH
2121

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
# webrpc OpenAPI 3.x (Swagger) generator <!-- omit in toc -->
1+
# webrpc OpenAPI 3.2.0 (Swagger) generator <!-- omit in toc -->
22

33
This repo contains the templates used by the [webrpc-gen](https://github.com/webrpc/webrpc) cli to code-generate OpenAPI documentation from webrpc schema.
44

5-
- [Generate OpenAPI 3.x YAML file](#generate-openapi-3x-yaml-file)
5+
- [Generate OpenAPI 3.2.0 YAML file](#generate-openapi-320-yaml-file)
66
- [Set custom template variables](#set-custom-template-variables)
77
- [Open in Swagger UI](#open-in-swagger-ui)
88
- [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
1212
- [Authors](#authors)
1313
- [License](#license)
1414

15-
# Generate OpenAPI 3.x YAML file
15+
# Generate OpenAPI 3.2.0 YAML file
1616
```bash
1717
webrpc-gen -schema=./proto.ridl -target=openapi -out petstore.gen.yaml
1818
```

_examples/openapi.gen.yaml

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
# example v0.0.1 9814b024890e4f9bf0fb6406686c29bcc402b24a
22
# --
3-
# Code generated by webrpc-gen@v0.25.0 with ../ generator; DO NOT EDIT
3+
# Code generated by webrpc-gen@v0.31.0 with ../ generator; DO NOT EDIT
44
#
55
# 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' } }
6-
openapi: 3.0.0
6+
openapi: 3.2.0
77
info:
88
title: 'Example webrpc API'
99
version: 'v22.11.8'
@@ -189,7 +189,7 @@ components:
189189
status:
190190
type: number
191191
example: 500
192-
ErrorWebrpcClientDisconnected:
192+
ErrorWebrpcClientAborted:
193193
type: object
194194
required:
195195
- error
@@ -199,13 +199,13 @@ components:
199199
properties:
200200
error:
201201
type: string
202-
example: "WebrpcClientDisconnected"
202+
example: "WebrpcClientAborted"
203203
code:
204204
type: number
205205
example: -8
206206
msg:
207207
type: string
208-
example: "client disconnected"
208+
example: "request aborted by client"
209209
cause:
210210
type: string
211211
status:
@@ -528,7 +528,7 @@ paths:
528528
- $ref: '#/components/schemas/ErrorWebrpcBadRoute'
529529
- $ref: '#/components/schemas/ErrorWebrpcBadMethod'
530530
- $ref: '#/components/schemas/ErrorWebrpcBadRequest'
531-
- $ref: '#/components/schemas/ErrorWebrpcClientDisconnected'
531+
- $ref: '#/components/schemas/ErrorWebrpcClientAborted'
532532
- $ref: '#/components/schemas/ErrorWebrpcStreamLost'
533533
- $ref: '#/components/schemas/ErrorRateLimited'
534534
'5XX':
@@ -572,7 +572,7 @@ paths:
572572
- $ref: '#/components/schemas/ErrorWebrpcBadRoute'
573573
- $ref: '#/components/schemas/ErrorWebrpcBadMethod'
574574
- $ref: '#/components/schemas/ErrorWebrpcBadRequest'
575-
- $ref: '#/components/schemas/ErrorWebrpcClientDisconnected'
575+
- $ref: '#/components/schemas/ErrorWebrpcClientAborted'
576576
- $ref: '#/components/schemas/ErrorWebrpcStreamLost'
577577
- $ref: '#/components/schemas/ErrorRateLimited'
578578
'5XX':
@@ -617,7 +617,7 @@ paths:
617617
- $ref: '#/components/schemas/ErrorWebrpcBadRoute'
618618
- $ref: '#/components/schemas/ErrorWebrpcBadMethod'
619619
- $ref: '#/components/schemas/ErrorWebrpcBadRequest'
620-
- $ref: '#/components/schemas/ErrorWebrpcClientDisconnected'
620+
- $ref: '#/components/schemas/ErrorWebrpcClientAborted'
621621
- $ref: '#/components/schemas/ErrorWebrpcStreamLost'
622622
- $ref: '#/components/schemas/ErrorRateLimited'
623623
'5XX':
@@ -665,7 +665,7 @@ paths:
665665
- $ref: '#/components/schemas/ErrorWebrpcBadRoute'
666666
- $ref: '#/components/schemas/ErrorWebrpcBadMethod'
667667
- $ref: '#/components/schemas/ErrorWebrpcBadRequest'
668-
- $ref: '#/components/schemas/ErrorWebrpcClientDisconnected'
668+
- $ref: '#/components/schemas/ErrorWebrpcClientAborted'
669669
- $ref: '#/components/schemas/ErrorWebrpcStreamLost'
670670
- $ref: '#/components/schemas/ErrorRateLimited'
671671
'5XX':
@@ -708,7 +708,7 @@ paths:
708708
- $ref: '#/components/schemas/ErrorWebrpcBadRoute'
709709
- $ref: '#/components/schemas/ErrorWebrpcBadMethod'
710710
- $ref: '#/components/schemas/ErrorWebrpcBadRequest'
711-
- $ref: '#/components/schemas/ErrorWebrpcClientDisconnected'
711+
- $ref: '#/components/schemas/ErrorWebrpcClientAborted'
712712
- $ref: '#/components/schemas/ErrorWebrpcStreamLost'
713713
- $ref: '#/components/schemas/ErrorRateLimited'
714714
'5XX':
@@ -749,7 +749,7 @@ paths:
749749
- $ref: '#/components/schemas/ErrorWebrpcBadRoute'
750750
- $ref: '#/components/schemas/ErrorWebrpcBadMethod'
751751
- $ref: '#/components/schemas/ErrorWebrpcBadRequest'
752-
- $ref: '#/components/schemas/ErrorWebrpcClientDisconnected'
752+
- $ref: '#/components/schemas/ErrorWebrpcClientAborted'
753753
- $ref: '#/components/schemas/ErrorWebrpcStreamLost'
754754
- $ref: '#/components/schemas/ErrorRateLimited'
755755
'5XX':
@@ -790,7 +790,7 @@ paths:
790790
- $ref: '#/components/schemas/ErrorWebrpcBadRoute'
791791
- $ref: '#/components/schemas/ErrorWebrpcBadMethod'
792792
- $ref: '#/components/schemas/ErrorWebrpcBadRequest'
793-
- $ref: '#/components/schemas/ErrorWebrpcClientDisconnected'
793+
- $ref: '#/components/schemas/ErrorWebrpcClientAborted'
794794
- $ref: '#/components/schemas/ErrorWebrpcStreamLost'
795795
- $ref: '#/components/schemas/ErrorRateLimited'
796796
'5XX':
@@ -833,7 +833,7 @@ paths:
833833
- $ref: '#/components/schemas/ErrorWebrpcBadRoute'
834834
- $ref: '#/components/schemas/ErrorWebrpcBadMethod'
835835
- $ref: '#/components/schemas/ErrorWebrpcBadRequest'
836-
- $ref: '#/components/schemas/ErrorWebrpcClientDisconnected'
836+
- $ref: '#/components/schemas/ErrorWebrpcClientAborted'
837837
- $ref: '#/components/schemas/ErrorWebrpcStreamLost'
838838
- $ref: '#/components/schemas/ErrorRateLimited'
839839
'5XX':

main.go.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@
6969
# Code generated by webrpc-gen@{{.WebrpcGenVersion}} with {{.WebrpcTarget}} generator; DO NOT EDIT
7070
#
7171
# {{.WebrpcGenCommand}}
72-
openapi: 3.0.0
72+
openapi: 3.2.0
7373
info:
7474
title: '{{ get $opts "title" }}'
7575
version: '{{ get $opts "apiVersion" }}'

0 commit comments

Comments
 (0)