forked from grpc-ecosystem/grpc-gateway
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Apply additional Swagger properties using JSON.
Depends on PR grpc-ecosystem#134. Reverts 562956f.
- Loading branch information
Showing
4 changed files
with
133 additions
and
3 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,11 +5,39 @@ option go_package = "examplepb"; | |
// | ||
// Echo Service API consists of a single service which returns | ||
// a message. | ||
// | ||
// <!-- swagger extras start | ||
// { | ||
// "info": { | ||
// "title": "Echo Service", | ||
// "version": "1.0", | ||
// "contact": { | ||
// "name": "gRPC-Gateway project", | ||
// "url": "https://github.com/grpc-ecosystem/grpc-gateway", | ||
// "email": "[email protected]" | ||
// } | ||
// }, | ||
// "host": "localhost", | ||
// "externalDocs": { | ||
// "url": "https://github.com/grpc-ecosystem/grpc-gateway", | ||
// "description": "More about gRPC-Gateway" | ||
// } | ||
// } | ||
// swagger extras end --> | ||
package grpc.gateway.examples.examplepb; | ||
|
||
import "google/api/annotations.proto"; | ||
|
||
// SimpleMessage represents a simple message sent to the Echo service. | ||
// | ||
// <!-- swagger extras start | ||
// { | ||
// "externalDocs": { | ||
// "url": "http://github.com/grpc-ecosystem/grpc-gateway", | ||
// "description": "Find out more about EchoService" | ||
// } | ||
// } | ||
// swagger extras end --> | ||
message SimpleMessage { | ||
// Id represents the message identifier. | ||
string id = 1; | ||
|
@@ -21,6 +49,15 @@ service EchoService { | |
// | ||
// The message posted as the id parameter will also be | ||
// returned. | ||
// | ||
// <!-- swagger extras start | ||
// { | ||
// "externalDocs": { | ||
// "url": "http://github.com/grpc-ecosystem/grpc-gateway", | ||
// "description": "Find out more about EchoService" | ||
// } | ||
// } | ||
// swagger extras end --> | ||
rpc Echo(SimpleMessage) returns (SimpleMessage) { | ||
option (google.api.http) = { | ||
post: "/v1/example/echo/{id}" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,8 +3,14 @@ | |
"info": { | ||
"title": "Echo Service", | ||
"description": "Echo Service API consists of a single service which returns\na message.", | ||
"version": "version not set" | ||
"version": "1.0", | ||
"contact": { | ||
"name": "gRPC-Gateway project", | ||
"url": "https://github.com/gengo/grpc-gateway", | ||
"email": "[email protected]" | ||
} | ||
}, | ||
"host": "localhost", | ||
"schemes": [ | ||
"http", | ||
"https" | ||
|
@@ -39,7 +45,11 @@ | |
], | ||
"tags": [ | ||
"EchoService" | ||
] | ||
], | ||
"externalDocs": { | ||
"description": "Find out more about EchoService", | ||
"url": "http://github.com/gengo/grpc-gateway" | ||
} | ||
} | ||
}, | ||
"/v1/example/echo_body": { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters