Skip to content

Commit 5214e3a

Browse files
committed
Update old dependencies, support proto Editions in protoc-gen-api
1 parent e702cf6 commit 5214e3a

File tree

35 files changed

+1657
-1653
lines changed

35 files changed

+1657
-1653
lines changed

cmd/disco/main.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ import (
2222
"strings"
2323

2424
"github.com/docopt/docopt-go"
25-
"github.com/golang/protobuf/proto"
25+
"google.golang.org/protobuf/proto"
2626

2727
"github.com/google/gnostic/conversions"
2828
discovery "github.com/google/gnostic/discovery"

cmd/petstore-builder/main.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ import (
2020
"os"
2121
"path"
2222

23-
"github.com/golang/protobuf/proto"
23+
"google.golang.org/protobuf/proto"
2424
)
2525

2626
func usage() string {

cmd/protoc-gen-openapi/examples/google/example/library/v1/openapi_fq_schema_naming.yaml

+13-13
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
openapi: 3.0.3
55
info:
6-
title: LibraryService API
6+
title: google.example.library.v1.LibraryService API
77
description: |-
88
This API represents a simple digital library. It lets you manage Shelf
99
resources and Book resources in the library. It defines the following
@@ -21,7 +21,7 @@ paths:
2121
/v1/shelves:
2222
get:
2323
tags:
24-
- LibraryService
24+
- google.example.library.v1.LibraryService
2525
description: |-
2626
Lists shelves. The order is unspecified but deterministic. Newly created
2727
shelves will not necessarily be added to the end of this list.
@@ -59,7 +59,7 @@ paths:
5959
$ref: '#/components/schemas/google.rpc.Status'
6060
post:
6161
tags:
62-
- LibraryService
62+
- google.example.library.v1.LibraryService
6363
description: Creates a shelf, and returns the new Shelf.
6464
operationId: LibraryService_CreateShelf
6565
requestBody:
@@ -84,7 +84,7 @@ paths:
8484
/v1/shelves/{shelf}:
8585
get:
8686
tags:
87-
- LibraryService
87+
- google.example.library.v1.LibraryService
8888
description: Gets a shelf. Returns NOT_FOUND if the shelf does not exist.
8989
operationId: LibraryService_GetShelf
9090
parameters:
@@ -109,7 +109,7 @@ paths:
109109
$ref: '#/components/schemas/google.rpc.Status'
110110
delete:
111111
tags:
112-
- LibraryService
112+
- google.example.library.v1.LibraryService
113113
description: Deletes a shelf. Returns NOT_FOUND if the shelf does not exist.
114114
operationId: LibraryService_DeleteShelf
115115
parameters:
@@ -132,7 +132,7 @@ paths:
132132
/v1/shelves/{shelf}/books:
133133
get:
134134
tags:
135-
- LibraryService
135+
- google.example.library.v1.LibraryService
136136
description: |-
137137
Lists books in a shelf. The order is unspecified but deterministic. Newly
138138
created books will not necessarily be added to the end of this list.
@@ -177,7 +177,7 @@ paths:
177177
$ref: '#/components/schemas/google.rpc.Status'
178178
post:
179179
tags:
180-
- LibraryService
180+
- google.example.library.v1.LibraryService
181181
description: Creates a book, and returns the new Book.
182182
operationId: LibraryService_CreateBook
183183
parameters:
@@ -209,7 +209,7 @@ paths:
209209
/v1/shelves/{shelf}/books/{book}:
210210
get:
211211
tags:
212-
- LibraryService
212+
- google.example.library.v1.LibraryService
213213
description: Gets a book. Returns NOT_FOUND if the book does not exist.
214214
operationId: LibraryService_GetBook
215215
parameters:
@@ -240,7 +240,7 @@ paths:
240240
$ref: '#/components/schemas/google.rpc.Status'
241241
put:
242242
tags:
243-
- LibraryService
243+
- google.example.library.v1.LibraryService
244244
description: |-
245245
Updates a book. Returns INVALID_ARGUMENT if the name of the book
246246
is non-empty and does not equal the existing name.
@@ -284,7 +284,7 @@ paths:
284284
$ref: '#/components/schemas/google.rpc.Status'
285285
delete:
286286
tags:
287-
- LibraryService
287+
- google.example.library.v1.LibraryService
288288
description: Deletes a book. Returns NOT_FOUND if the book does not exist.
289289
operationId: LibraryService_DeleteBook
290290
parameters:
@@ -313,7 +313,7 @@ paths:
313313
/v1/shelves/{shelf}/books/{book}:move:
314314
post:
315315
tags:
316-
- LibraryService
316+
- google.example.library.v1.LibraryService
317317
description: |-
318318
Moves a book to another shelf, and returns the new book. The book
319319
id of the new book may not be the same as the original book.
@@ -353,7 +353,7 @@ paths:
353353
/v1/shelves/{shelf}:merge:
354354
post:
355355
tags:
356-
- LibraryService
356+
- google.example.library.v1.LibraryService
357357
description: |-
358358
Merges two shelves by adding all books from the shelf named
359359
`other_shelf_name` to shelf `name`, and deletes
@@ -546,4 +546,4 @@ components:
546546
description: A list of messages that carry the error details. There is a common set of message types for APIs to use.
547547
description: 'The `Status` type defines a logical error model that is suitable for different programming environments, including REST APIs and RPC APIs. It is used by [gRPC](https://github.com/grpc). Each `Status` message contains three pieces of data: error code, error message, and error details. You can find out more about this error model and how to work with it in the [API Design Guide](https://cloud.google.com/apis/design/errors).'
548548
tags:
549-
- name: LibraryService
549+
- name: google.example.library.v1.LibraryService

cmd/protoc-gen-openapi/examples/tests/bodymapping/openapi_fq_schema_naming.yaml

+3-3
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,13 @@
33

44
openapi: 3.0.3
55
info:
6-
title: Messaging API
6+
title: tests.bodymappying.message.v1.Messaging API
77
version: 0.0.1
88
paths:
99
/v1/messages/{messageId}:
1010
patch:
1111
tags:
12-
- Messaging
12+
- tests.bodymappying.message.v1.Messaging
1313
operationId: Messaging_UpdateMessage
1414
parameters:
1515
- name: messageId
@@ -70,4 +70,4 @@ components:
7070
text:
7171
type: string
7272
tags:
73-
- name: Messaging
73+
- name: tests.bodymappying.message.v1.Messaging

cmd/protoc-gen-openapi/examples/tests/enumoptions/openapi_fq_schema_naming.yaml

+3-3
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,14 @@
33

44
openapi: 3.0.3
55
info:
6-
title: Messaging API
6+
title: tests.enumoptions.message.v1.Messaging API
77
description: Messaging service
88
version: 0.0.1
99
paths:
1010
/v1/messages/{message_id}:
1111
post:
1212
tags:
13-
- Messaging
13+
- tests.enumoptions.message.v1.Messaging
1414
operationId: Messaging_CreateMessage
1515
parameters:
1616
- name: message_id
@@ -73,4 +73,4 @@ components:
7373
type: integer
7474
format: enum
7575
tags:
76-
- name: Messaging
76+
- name: tests.enumoptions.message.v1.Messaging

cmd/protoc-gen-openapi/examples/tests/jsonoptions/openapi_fq_schema_naming.yaml

+4-4
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,14 @@
33

44
openapi: 3.0.3
55
info:
6-
title: Messaging API
6+
title: tests.jsonnames.message.v1.Messaging API
77
description: Messaging service
88
version: 0.0.1
99
paths:
1010
/v1/messages/{messageId}:
1111
post:
1212
tags:
13-
- Messaging
13+
- tests.jsonnames.message.v1.Messaging
1414
operationId: Messaging_CreateMessage
1515
parameters:
1616
- name: messageId
@@ -44,7 +44,7 @@ paths:
4444
/v1/messages/{message_id}:
4545
patch:
4646
tags:
47-
- Messaging
47+
- tests.jsonnames.message.v1.Messaging
4848
operationId: Messaging_UpdateMessage
4949
parameters:
5050
- name: message_id
@@ -120,4 +120,4 @@ components:
120120
not_used:
121121
type: string
122122
tags:
123-
- name: Messaging
123+
- name: tests.jsonnames.message.v1.Messaging

cmd/protoc-gen-openapi/examples/tests/mapfields/openapi_fq_schema_naming.yaml

+3-3
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,13 @@
33

44
openapi: 3.0.3
55
info:
6-
title: Messaging API
6+
title: tests.mapfields.message.v1.Messaging API
77
version: 0.0.1
88
paths:
99
/v1/messages/{messageId}:
1010
patch:
1111
tags:
12-
- Messaging
12+
- tests.mapfields.message.v1.Messaging
1313
operationId: Messaging_UpdateMessage
1414
parameters:
1515
- name: messageId
@@ -110,4 +110,4 @@ components:
110110
label:
111111
type: string
112112
tags:
113-
- name: Messaging
113+
- name: tests.mapfields.message.v1.Messaging

cmd/protoc-gen-openapi/examples/tests/noannotations/openapi_fq_schema_naming.yaml

+3-3
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,13 @@
33

44
openapi: 3.0.3
55
info:
6-
title: Messaging1 API
6+
title: tests.noannotations.message.v1.Messaging1 API
77
version: 0.0.1
88
paths:
99
/v1/messages/{message_id}:
1010
patch:
1111
tags:
12-
- Messaging1
12+
- tests.noannotations.message.v1.Messaging1
1313
operationId: Messaging1_UpdateMessage
1414
parameters:
1515
- name: message_id
@@ -70,4 +70,4 @@ components:
7070
label:
7171
type: string
7272
tags:
73-
- name: Messaging1
73+
- name: tests.noannotations.message.v1.Messaging1

cmd/protoc-gen-openapi/examples/tests/openapiv3annotations/openapi_fq_schema_naming.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ paths:
1717
/v1/messages/{message_id}:
1818
patch:
1919
tags:
20-
- Messaging1
20+
- tests.openapiv3annotations.message.v1.Messaging1
2121
operationId: Messaging1_UpdateMessage
2222
parameters:
2323
- name: message_id
@@ -87,4 +87,4 @@ components:
8787
type: http
8888
scheme: basic
8989
tags:
90-
- name: Messaging1
90+
- name: tests.openapiv3annotations.message.v1.Messaging1

cmd/protoc-gen-openapi/examples/tests/pathparams/openapi_fq_schema_naming.yaml

+5-5
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,13 @@
33

44
openapi: 3.0.3
55
info:
6-
title: Messaging API
6+
title: tests.pathparams.message.v1.Messaging API
77
version: 0.0.1
88
paths:
99
/v1/messages/{messageId}:
1010
get:
1111
tags:
12-
- Messaging
12+
- tests.pathparams.message.v1.Messaging
1313
operationId: Messaging_GetMessage
1414
parameters:
1515
- name: messageId
@@ -36,7 +36,7 @@ paths:
3636
$ref: '#/components/schemas/google.rpc.Status'
3737
post:
3838
tags:
39-
- Messaging
39+
- tests.pathparams.message.v1.Messaging
4040
operationId: Messaging_CreateMessage
4141
parameters:
4242
- name: messageId
@@ -66,7 +66,7 @@ paths:
6666
/v1/users/{userId}/messages/{messageId}:
6767
get:
6868
tags:
69-
- Messaging
69+
- tests.pathparams.message.v1.Messaging
7070
operationId: Messaging_GetUserMessage
7171
parameters:
7272
- name: userId
@@ -130,4 +130,4 @@ components:
130130
maybe:
131131
type: string
132132
tags:
133-
- name: Messaging
133+
- name: tests.pathparams.message.v1.Messaging

cmd/protoc-gen-openapi/examples/tests/protobuftypes/openapi_fq_schema_naming.yaml

+8-8
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,15 @@
33

44
openapi: 3.0.3
55
info:
6-
title: Messaging API
6+
title: tests.protobuftypes.message.v1.Messaging API
77
version: 0.0.1
88
servers:
99
- url: https://foo.googleapi.com
1010
paths:
1111
/v1/messages:
1212
get:
1313
tags:
14-
- Messaging
14+
- tests.protobuftypes.message.v1.Messaging
1515
operationId: Messaging_ListMessages
1616
responses:
1717
"200":
@@ -29,7 +29,7 @@ paths:
2929
/v1/messages/{messageId}:
3030
get:
3131
tags:
32-
- Messaging
32+
- tests.protobuftypes.message.v1.Messaging
3333
operationId: Messaging_GetMessage
3434
parameters:
3535
- name: messageId
@@ -165,7 +165,7 @@ paths:
165165
$ref: '#/components/schemas/google.rpc.Status'
166166
post:
167167
tags:
168-
- Messaging
168+
- tests.protobuftypes.message.v1.Messaging
169169
operationId: Messaging_CreateMessage
170170
parameters:
171171
- name: messageId
@@ -194,7 +194,7 @@ paths:
194194
$ref: '#/components/schemas/google.rpc.Status'
195195
patch:
196196
tags:
197-
- Messaging
197+
- tests.protobuftypes.message.v1.Messaging
198198
operationId: Messaging_UpdateMessage
199199
parameters:
200200
- name: messageId
@@ -337,7 +337,7 @@ paths:
337337
/v1/messages:csv:
338338
get:
339339
tags:
340-
- Messaging
340+
- tests.protobuftypes.message.v1.Messaging
341341
description: |-
342342
OpenAPI does not allow requestBody in GET operations.
343343
But it should not convert it to query params either.
@@ -355,7 +355,7 @@ paths:
355355
$ref: '#/components/schemas/google.rpc.Status'
356356
post:
357357
tags:
358-
- Messaging
358+
- tests.protobuftypes.message.v1.Messaging
359359
operationId: Messaging_CreateMessagesFromCSV
360360
requestBody:
361361
content:
@@ -514,4 +514,4 @@ components:
514514
type: integer
515515
format: int32
516516
tags:
517-
- name: Messaging
517+
- name: tests.protobuftypes.message.v1.Messaging

cmd/protoc-gen-openapi/examples/tests/rpctypes/openapi_fq_schema_naming.yaml

+3-3
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,13 @@
33

44
openapi: 3.0.3
55
info:
6-
title: Status API
6+
title: tests.rpctypes.message.v1.Status API
77
version: 0.0.1
88
paths:
99
/v1/status:
1010
get:
1111
tags:
12-
- Status
12+
- tests.rpctypes.message.v1.Status
1313
operationId: Status_GetStatus
1414
responses:
1515
"200":
@@ -51,4 +51,4 @@ components:
5151
description: A list of messages that carry the error details. There is a common set of message types for APIs to use.
5252
description: 'The `Status` type defines a logical error model that is suitable for different programming environments, including REST APIs and RPC APIs. It is used by [gRPC](https://github.com/grpc). Each `Status` message contains three pieces of data: error code, error message, and error details. You can find out more about this error model and how to work with it in the [API Design Guide](https://cloud.google.com/apis/design/errors).'
5353
tags:
54-
- name: Status
54+
- name: tests.rpctypes.message.v1.Status

0 commit comments

Comments
 (0)