...
1---
2swagger: "2.0"
3info:
4 description: "Unannotated Echo Service\nSimilar to echo_service.proto but without\
5 \ annotations. See\nunannotated_echo_service.yaml for the equivalent of the annotations\
6 \ in\ngRPC API configuration format.\n\nEcho Service API consists of a single\
7 \ service which returns\na message."
8 version: "version not set"
9 title: "examples/internal/proto/examplepb/unannotated_echo_service.proto"
10consumes:
11- "application/json"
12produces:
13- "application/json"
14paths:
15 /v1/example/echo/{id}:
16 post:
17 tags:
18 - "UnannotatedEchoService"
19 summary: "Echo method receives a simple message and returns it."
20 description: "The message posted as the id parameter will also be\nreturned."
21 operationId: "UnannotatedEchoService_Echo"
22 parameters:
23 - name: "id"
24 in: "path"
25 description: "Id represents the message identifier."
26 required: true
27 type: "string"
28 x-exportParamName: "Id"
29 responses:
30 200:
31 description: "A successful response."
32 schema:
33 $ref: "#/definitions/examplepbUnannotatedSimpleMessage"
34 default:
35 description: "An unexpected error response."
36 schema:
37 $ref: "#/definitions/runtimeError"
38 /v1/example/echo/{id}/{num}:
39 get:
40 tags:
41 - "UnannotatedEchoService"
42 summary: "Echo method receives a simple message and returns it."
43 description: "The message posted as the id parameter will also be\nreturned."
44 operationId: "UnannotatedEchoService_Echo2"
45 parameters:
46 - name: "id"
47 in: "path"
48 description: "Id represents the message identifier."
49 required: true
50 type: "string"
51 x-exportParamName: "Id"
52 - name: "num"
53 in: "path"
54 required: true
55 type: "string"
56 format: "int64"
57 x-exportParamName: "Num"
58 - name: "duration"
59 in: "query"
60 required: false
61 type: "string"
62 x-exportParamName: "Duration"
63 x-optionalDataType: "String"
64 responses:
65 200:
66 description: "A successful response."
67 schema:
68 $ref: "#/definitions/examplepbUnannotatedSimpleMessage"
69 default:
70 description: "An unexpected error response."
71 schema:
72 $ref: "#/definitions/runtimeError"
73 /v1/example/echo_body:
74 post:
75 tags:
76 - "UnannotatedEchoService"
77 summary: "EchoBody method receives a simple message and returns it."
78 operationId: "UnannotatedEchoService_EchoBody"
79 parameters:
80 - in: "body"
81 name: "body"
82 required: true
83 schema:
84 $ref: "#/definitions/examplepbUnannotatedSimpleMessage"
85 x-exportParamName: "Body"
86 responses:
87 200:
88 description: "A successful response."
89 schema:
90 $ref: "#/definitions/examplepbUnannotatedSimpleMessage"
91 default:
92 description: "An unexpected error response."
93 schema:
94 $ref: "#/definitions/runtimeError"
95 /v1/example/echo_delete:
96 delete:
97 tags:
98 - "UnannotatedEchoService"
99 summary: "EchoDelete method receives a simple message and returns it."
100 operationId: "UnannotatedEchoService_EchoDelete"
101 parameters:
102 - name: "id"
103 in: "query"
104 description: "Id represents the message identifier."
105 required: false
106 type: "string"
107 x-exportParamName: "Id"
108 x-optionalDataType: "String"
109 - name: "num"
110 in: "query"
111 required: false
112 type: "string"
113 format: "int64"
114 x-exportParamName: "Num"
115 x-optionalDataType: "String"
116 - name: "duration"
117 in: "query"
118 required: false
119 type: "string"
120 x-exportParamName: "Duration"
121 x-optionalDataType: "String"
122 responses:
123 200:
124 description: "A successful response."
125 schema:
126 $ref: "#/definitions/examplepbUnannotatedSimpleMessage"
127 default:
128 description: "An unexpected error response."
129 schema:
130 $ref: "#/definitions/runtimeError"
131definitions:
132 examplepbUnannotatedSimpleMessage:
133 type: "object"
134 properties:
135 id:
136 type: "string"
137 description: "Id represents the message identifier."
138 num:
139 type: "string"
140 format: "int64"
141 duration:
142 type: "string"
143 description: "UnannotatedSimpleMessage represents a simple message sent to the\
144 \ unannotated Echo service."
145 example:
146 duration: "duration"
147 num: "num"
148 id: "id"
149 protobufAny:
150 type: "object"
151 properties:
152 type_url:
153 type: "string"
154 description: "A URL/resource name that uniquely identifies the type of the\
155 \ serialized\nprotocol buffer message. This string must contain at least\n\
156 one \"/\" character. The last segment of the URL's path must represent\n\
157 the fully qualified name of the type (as in\n`path/google.protobuf.Duration`).\
158 \ The name should be in a canonical form\n(e.g., leading \".\" is not accepted).\n\
159 \nIn practice, teams usually precompile into the binary all types that they\n\
160 expect it to use in the context of Any. However, for URLs which use the\n\
161 scheme `http`, `https`, or no scheme, one can optionally set up a type\n\
162 server that maps type URLs to message definitions as follows:\n\n* If no\
163 \ scheme is provided, `https` is assumed.\n* An HTTP GET on the URL must\
164 \ yield a [google.protobuf.Type][]\n value in binary format, or produce\
165 \ an error.\n* Applications are allowed to cache lookup results based on\
166 \ the\n URL, or have them precompiled into a binary to avoid any\n lookup.\
167 \ Therefore, binary compatibility needs to be preserved\n on changes to\
168 \ types. (Use versioned type names to manage\n breaking changes.)\n\nNote:\
169 \ this functionality is not currently available in the official\nprotobuf\
170 \ release, and it is not used for type URLs beginning with\ntype.googleapis.com.\n\
171 \nSchemes other than `http`, `https` (or the empty scheme) might be\nused\
172 \ with implementation specific semantics."
173 value:
174 type: "string"
175 format: "byte"
176 description: "Must be a valid serialized protocol buffer of the above specified\
177 \ type."
178 pattern: "^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$"
179 description: "`Any` contains an arbitrary serialized protocol buffer message along\
180 \ with a\nURL that describes the type of the serialized message.\n\nProtobuf\
181 \ library provides support to pack/unpack Any values in the form\nof utility\
182 \ functions or additional generated methods of the Any type.\n\nExample 1: Pack\
183 \ and unpack a message in C++.\n\n Foo foo = ...;\n Any any;\n any.PackFrom(foo);\n\
184 \ ...\n if (any.UnpackTo(&foo)) {\n ...\n }\n\nExample 2: Pack\
185 \ and unpack a message in Java.\n\n Foo foo = ...;\n Any any = Any.pack(foo);\n\
186 \ ...\n if (any.is(Foo.class)) {\n foo = any.unpack(Foo.class);\n\
187 \ }\n\n Example 3: Pack and unpack a message in Python.\n\n foo = Foo(...)\n\
188 \ any = Any()\n any.Pack(foo)\n ...\n if any.Is(Foo.DESCRIPTOR):\n\
189 \ any.Unpack(foo)\n ...\n\n Example 4: Pack and unpack a message in\
190 \ Go\n\n foo := &pb.Foo{...}\n any, err := ptypes.MarshalAny(foo)\n\
191 \ ...\n foo := &pb.Foo{}\n if err := ptypes.UnmarshalAny(any, foo);\
192 \ err != nil {\n ...\n }\n\nThe pack methods provided by protobuf\
193 \ library will by default use\n'type.googleapis.com/full.type.name' as the type\
194 \ URL and the unpack\nmethods only use the fully qualified type name after the\
195 \ last '/'\nin the type URL, for example \"foo.bar.com/x/y.z\" will yield type\n\
196 name \"y.z\".\n\n\nJSON\n====\nThe JSON representation of an `Any` value uses\
197 \ the regular\nrepresentation of the deserialized, embedded message, with an\n\
198 additional field `@type` which contains the type URL. Example:\n\n package\
199 \ google.profile;\n message Person {\n string first_name = 1;\n \
200 \ string last_name = 2;\n }\n\n {\n \"@type\": \"type.googleapis.com/google.profile.Person\"\
201 ,\n \"firstName\": <string>,\n \"lastName\": <string>\n }\n\nIf\
202 \ the embedded message type is well-known and has a custom JSON\nrepresentation,\
203 \ that representation will be embedded adding a field\n`value` which holds the\
204 \ custom JSON in addition to the `@type`\nfield. Example (for message [google.protobuf.Duration][]):\n\
205 \n {\n \"@type\": \"type.googleapis.com/google.protobuf.Duration\",\n\
206 \ \"value\": \"1.212s\"\n }"
207 runtimeError:
208 type: "object"
209 properties:
210 error:
211 type: "string"
212 code:
213 type: "integer"
214 format: "int32"
215 message:
216 type: "string"
217 details:
218 type: "array"
219 items:
220 $ref: "#/definitions/protobufAny"
View as plain text