Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: protoc-gen-swagger: Implement Response Header(s) object, Implem… #1730

Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions examples/internal/clients/abe/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ go_library(
"model_examplepb_a_bit_of_everything_repeated.go",
"model_examplepb_body.go",
"model_examplepb_book.go",
"model_examplepb_error_object.go",
"model_examplepb_error_response.go",
"model_examplepb_numeric_enum.go",
"model_examplepb_update_v2_request.go",
"model_message_path_enum_nested_path_enum.go",
Expand Down
125 changes: 125 additions & 0 deletions examples/internal/clients/abe/api/swagger.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,10 @@ paths:
description: "I'm a teapot."
schema:
$ref: "#/definitions/examplepbNumericEnum"
500:
description: "Server error"
schema:
$ref: "#/definitions/examplepbErrorResponse"
default:
description: "An unexpected error response."
schema:
Expand Down Expand Up @@ -97,6 +101,10 @@ paths:
description: "I'm a teapot."
schema:
$ref: "#/definitions/examplepbNumericEnum"
500:
description: "Server error"
schema:
$ref: "#/definitions/examplepbErrorResponse"
503:
description: "Returned when the resource is temporarily unavailable."
schema: {}
Expand Down Expand Up @@ -391,6 +399,10 @@ paths:
description: "I'm a teapot."
schema:
$ref: "#/definitions/examplepbNumericEnum"
500:
description: "Server error"
schema:
$ref: "#/definitions/examplepbErrorResponse"
default:
description: "An unexpected error response."
schema:
Expand Down Expand Up @@ -685,6 +697,10 @@ paths:
description: "I'm a teapot."
schema:
$ref: "#/definitions/examplepbNumericEnum"
500:
description: "Server error"
schema:
$ref: "#/definitions/examplepbErrorResponse"
default:
description: "An unexpected error response."
schema:
Expand Down Expand Up @@ -966,6 +982,10 @@ paths:
description: "I'm a teapot."
schema:
$ref: "#/definitions/examplepbNumericEnum"
500:
description: "Server error"
schema:
$ref: "#/definitions/examplepbErrorResponse"
default:
description: "An unexpected error response."
schema:
Expand Down Expand Up @@ -1266,6 +1286,10 @@ paths:
description: "I'm a teapot."
schema:
$ref: "#/definitions/examplepbNumericEnum"
500:
description: "Server error"
schema:
$ref: "#/definitions/examplepbErrorResponse"
default:
description: "An unexpected error response."
schema:
Expand Down Expand Up @@ -1423,6 +1447,10 @@ paths:
description: "I'm a teapot."
schema:
$ref: "#/definitions/examplepbNumericEnum"
500:
description: "Server error"
schema:
$ref: "#/definitions/examplepbErrorResponse"
default:
description: "An unexpected error response."
schema:
Expand Down Expand Up @@ -1463,6 +1491,10 @@ paths:
description: "I'm a teapot."
schema:
$ref: "#/definitions/examplepbNumericEnum"
500:
description: "Server error"
schema:
$ref: "#/definitions/examplepbErrorResponse"
default:
description: "An unexpected error response."
schema:
Expand Down Expand Up @@ -1496,6 +1528,10 @@ paths:
description: "I'm a teapot."
schema:
$ref: "#/definitions/examplepbNumericEnum"
500:
description: "Server error"
schema:
$ref: "#/definitions/examplepbErrorResponse"
default:
description: "An unexpected error response."
schema:
Expand Down Expand Up @@ -1533,6 +1569,10 @@ paths:
description: "I'm a teapot."
schema:
$ref: "#/definitions/examplepbNumericEnum"
500:
description: "Server error"
schema:
$ref: "#/definitions/examplepbErrorResponse"
default:
description: "An unexpected error response."
schema:
Expand Down Expand Up @@ -1564,6 +1604,10 @@ paths:
description: "I'm a teapot."
schema:
$ref: "#/definitions/examplepbNumericEnum"
500:
description: "Server error"
schema:
$ref: "#/definitions/examplepbErrorResponse"
default:
description: "An unexpected error response."
schema:
Expand Down Expand Up @@ -1760,6 +1804,10 @@ paths:
description: "I'm a teapot."
schema:
$ref: "#/definitions/examplepbNumericEnum"
500:
description: "Server error"
schema:
$ref: "#/definitions/examplepbErrorResponse"
default:
description: "An unexpected error response."
schema:
Expand Down Expand Up @@ -1811,6 +1859,10 @@ paths:
description: "I'm a teapot."
schema:
$ref: "#/definitions/examplepbNumericEnum"
500:
description: "Server error"
schema:
$ref: "#/definitions/examplepbErrorResponse"
default:
description: "An unexpected error response."
schema:
Expand Down Expand Up @@ -1858,6 +1910,10 @@ paths:
description: "I'm a teapot."
schema:
$ref: "#/definitions/examplepbNumericEnum"
500:
description: "Server error"
schema:
$ref: "#/definitions/examplepbErrorResponse"
default:
description: "An unexpected error response."
schema:
Expand Down Expand Up @@ -1904,6 +1960,10 @@ paths:
description: "I'm a teapot."
schema:
$ref: "#/definitions/examplepbNumericEnum"
500:
description: "Server error"
schema:
$ref: "#/definitions/examplepbErrorResponse"
default:
description: "An unexpected error response."
schema:
Expand Down Expand Up @@ -1943,6 +2003,10 @@ paths:
description: "I'm a teapot."
schema:
$ref: "#/definitions/examplepbNumericEnum"
500:
description: "Server error"
schema:
$ref: "#/definitions/examplepbErrorResponse"
503:
description: "Returned when the resource is temporarily unavailable."
schema: {}
Expand Down Expand Up @@ -1988,6 +2052,10 @@ paths:
description: "I'm a teapot."
schema:
$ref: "#/definitions/examplepbNumericEnum"
500:
description: "Server error"
schema:
$ref: "#/definitions/examplepbErrorResponse"
503:
description: "Returned when the resource is temporarily unavailable."
schema: {}
Expand Down Expand Up @@ -2022,6 +2090,10 @@ paths:
description: "I'm a teapot."
schema:
$ref: "#/definitions/examplepbNumericEnum"
500:
description: "Server error"
schema:
$ref: "#/definitions/examplepbErrorResponse"
default:
description: "An unexpected error response."
schema:
Expand Down Expand Up @@ -2049,6 +2121,10 @@ paths:
description: "I'm a teapot."
schema:
$ref: "#/definitions/examplepbNumericEnum"
500:
description: "Server error"
schema:
$ref: "#/definitions/examplepbErrorResponse"
default:
description: "An unexpected error response."
schema:
Expand Down Expand Up @@ -2079,6 +2155,10 @@ paths:
description: "I'm a teapot."
schema:
$ref: "#/definitions/examplepbNumericEnum"
500:
description: "Server error"
schema:
$ref: "#/definitions/examplepbErrorResponse"
default:
description: "An unexpected error response."
schema:
Expand Down Expand Up @@ -2117,6 +2197,10 @@ paths:
description: "I'm a teapot."
schema:
$ref: "#/definitions/examplepbNumericEnum"
500:
description: "Server error"
schema:
$ref: "#/definitions/examplepbErrorResponse"
default:
description: "An unexpected error response."
schema:
Expand Down Expand Up @@ -2144,6 +2228,10 @@ paths:
description: "I'm a teapot."
schema:
$ref: "#/definitions/examplepbNumericEnum"
500:
description: "Server error"
schema:
$ref: "#/definitions/examplepbErrorResponse"
default:
description: "An unexpected error response."
schema:
Expand Down Expand Up @@ -2182,6 +2270,10 @@ paths:
description: "I'm a teapot."
schema:
$ref: "#/definitions/examplepbNumericEnum"
500:
description: "Server error"
schema:
$ref: "#/definitions/examplepbErrorResponse"
default:
description: "An unexpected error response."
schema:
Expand Down Expand Up @@ -2217,6 +2309,10 @@ paths:
description: "I'm a teapot."
schema:
$ref: "#/definitions/examplepbNumericEnum"
500:
description: "Server error"
schema:
$ref: "#/definitions/examplepbErrorResponse"
default:
description: "An unexpected error response."
schema:
Expand Down Expand Up @@ -2255,6 +2351,10 @@ paths:
description: "I'm a teapot."
schema:
$ref: "#/definitions/examplepbNumericEnum"
500:
description: "Server error"
schema:
$ref: "#/definitions/examplepbErrorResponse"
default:
description: "An unexpected error response."
schema:
Expand Down Expand Up @@ -2566,6 +2666,31 @@ definitions:
create_time: "2000-01-23T04:56:07.000+00:00"
name: "name"
id: "id"
examplepbErrorObject:
type: "object"
properties:
code:
type: "integer"
format: "integer"
description: "Response code"
title: "code"
message:
type: "string"
description: "Response message"
title: "message"
pattern: "^[a-zA-Z0-9]{1, 32}$"
examplepbErrorResponse:
type: "object"
properties:
correlationId:
type: "string"
format: "uuid"
example: "2438ac3c-37eb-4902-adef-ed16b4431030"
description: "Unique event identifier for server requests"
title: "x-correlation-id"
pattern: "^[0-9A-F]{8}-[0-9A-F]{4}-4[0-9A-F]{3}-[89AB][0-9A-F]{3}-[0-9A-F]{12}$"
error:
$ref: "#/definitions/examplepbErrorObject"
examplepbNumericEnum:
type: "string"
description: "NumericEnum is one or zero.\n\n - ZERO: ZERO means 0\n - ONE: ONE\
Expand Down
Loading