1{
2 "swagger": "2.0",
3 "info": {
4 "title": "examples/internal/proto/examplepb/visibility_rule_echo_service.proto",
5 "description": "Visibility Rule Echo Service\nSimilar to echo_service.proto but with annotations to change visibility\nof services, methods, fields and enum values.\n\n`google.api.VisibilityRule` annotations are added to customize where they are generated.\nCombined with the option `visibility_restriction_selectors` overlapping rules will appear in the OpenAPI output.\nElements without `google.api.VisibilityRule` annotations will appear as usual in the generated output.\n\nThese restrictions and selectors are completely arbitrary and you can define whatever values or hierarchies you want.\nIn this example `INTERNAL`, `PREVIEW` are used, but `INTERNAL`, `ALPHA`, `BETA`, `RELEASED`, or anything else could be used if you wish.",
6 "version": "version not set"
7 },
8 "tags": [
9 {
10 "name": "VisibilityRuleEchoService"
11 },
12 {
13 "name": "VisibilityRuleInternalEchoService"
14 }
15 ],
16 "consumes": [
17 "application/json"
18 ],
19 "produces": [
20 "application/json"
21 ],
22 "paths": {
23 "/v1/example/echo/{id}": {
24 "post": {
25 "summary": "Echo method receives a simple message and returns it.\nIt should always be visible in the open API output.",
26 "operationId": "VisibilityRuleEchoService_Echo",
27 "responses": {
28 "200": {
29 "description": "A successful response.",
30 "schema": {
31 "$ref": "#/definitions/examplepbVisibilityRuleSimpleMessage"
32 }
33 },
34 "default": {
35 "description": "An unexpected error response.",
36 "schema": {
37 "$ref": "#/definitions/rpcStatus"
38 }
39 }
40 },
41 "parameters": [
42 {
43 "name": "id",
44 "description": "Id represents the message identifier.",
45 "in": "path",
46 "required": true,
47 "type": "string"
48 },
49 {
50 "name": "num",
51 "in": "query",
52 "required": false,
53 "type": "string",
54 "format": "int64"
55 },
56 {
57 "name": "lineNum",
58 "in": "query",
59 "required": false,
60 "type": "string",
61 "format": "int64"
62 },
63 {
64 "name": "lang",
65 "in": "query",
66 "required": false,
67 "type": "string"
68 },
69 {
70 "name": "status.progress",
71 "in": "query",
72 "required": false,
73 "type": "string",
74 "format": "int64"
75 },
76 {
77 "name": "status.note",
78 "in": "query",
79 "required": false,
80 "type": "string"
81 },
82 {
83 "name": "status.internalField",
84 "in": "query",
85 "required": false,
86 "type": "string"
87 },
88 {
89 "name": "status.previewField",
90 "in": "query",
91 "required": false,
92 "type": "string"
93 },
94 {
95 "name": "en",
96 "in": "query",
97 "required": false,
98 "type": "string",
99 "format": "int64"
100 },
101 {
102 "name": "no.progress",
103 "in": "query",
104 "required": false,
105 "type": "string",
106 "format": "int64"
107 },
108 {
109 "name": "no.note",
110 "in": "query",
111 "required": false,
112 "type": "string"
113 },
114 {
115 "name": "no.internalField",
116 "in": "query",
117 "required": false,
118 "type": "string"
119 },
120 {
121 "name": "no.previewField",
122 "in": "query",
123 "required": false,
124 "type": "string"
125 },
126 {
127 "name": "internalField",
128 "in": "query",
129 "required": false,
130 "type": "string"
131 },
132 {
133 "name": "previewField",
134 "in": "query",
135 "required": false,
136 "type": "string"
137 },
138 {
139 "name": "anEnum",
140 "in": "query",
141 "required": false,
142 "type": "string",
143 "enum": [
144 "VISIBILITY_ENUM_UNSPECIFIED",
145 "VISIBILITY_ENUM_VISIBLE",
146 "VISIBILITY_ENUM_INTERNAL",
147 "VISIBILITY_ENUM_PREVIEW"
148 ],
149 "default": "VISIBILITY_ENUM_UNSPECIFIED"
150 }
151 ],
152 "tags": [
153 "VisibilityRuleEchoService"
154 ]
155 }
156 },
157 "/v1/example/echo_internal": {
158 "get": {
159 "summary": "EchoInternal is an internal API that should only be visible in the OpenAPI spec\nif `visibility_restriction_selectors` includes \"INTERNAL\".",
160 "operationId": "VisibilityRuleEchoService_EchoInternal",
161 "responses": {
162 "200": {
163 "description": "A successful response.",
164 "schema": {
165 "$ref": "#/definitions/examplepbVisibilityRuleSimpleMessage"
166 }
167 },
168 "default": {
169 "description": "An unexpected error response.",
170 "schema": {
171 "$ref": "#/definitions/rpcStatus"
172 }
173 }
174 },
175 "parameters": [
176 {
177 "name": "id",
178 "description": "Id represents the message identifier.",
179 "in": "query",
180 "required": false,
181 "type": "string"
182 },
183 {
184 "name": "num",
185 "in": "query",
186 "required": false,
187 "type": "string",
188 "format": "int64"
189 },
190 {
191 "name": "lineNum",
192 "in": "query",
193 "required": false,
194 "type": "string",
195 "format": "int64"
196 },
197 {
198 "name": "lang",
199 "in": "query",
200 "required": false,
201 "type": "string"
202 },
203 {
204 "name": "status.progress",
205 "in": "query",
206 "required": false,
207 "type": "string",
208 "format": "int64"
209 },
210 {
211 "name": "status.note",
212 "in": "query",
213 "required": false,
214 "type": "string"
215 },
216 {
217 "name": "status.internalField",
218 "in": "query",
219 "required": false,
220 "type": "string"
221 },
222 {
223 "name": "status.previewField",
224 "in": "query",
225 "required": false,
226 "type": "string"
227 },
228 {
229 "name": "en",
230 "in": "query",
231 "required": false,
232 "type": "string",
233 "format": "int64"
234 },
235 {
236 "name": "no.progress",
237 "in": "query",
238 "required": false,
239 "type": "string",
240 "format": "int64"
241 },
242 {
243 "name": "no.note",
244 "in": "query",
245 "required": false,
246 "type": "string"
247 },
248 {
249 "name": "no.internalField",
250 "in": "query",
251 "required": false,
252 "type": "string"
253 },
254 {
255 "name": "no.previewField",
256 "in": "query",
257 "required": false,
258 "type": "string"
259 },
260 {
261 "name": "internalField",
262 "in": "query",
263 "required": false,
264 "type": "string"
265 },
266 {
267 "name": "previewField",
268 "in": "query",
269 "required": false,
270 "type": "string"
271 },
272 {
273 "name": "anEnum",
274 "in": "query",
275 "required": false,
276 "type": "string",
277 "enum": [
278 "VISIBILITY_ENUM_UNSPECIFIED",
279 "VISIBILITY_ENUM_VISIBLE",
280 "VISIBILITY_ENUM_INTERNAL",
281 "VISIBILITY_ENUM_PREVIEW"
282 ],
283 "default": "VISIBILITY_ENUM_UNSPECIFIED"
284 }
285 ],
286 "tags": [
287 "VisibilityRuleEchoService"
288 ]
289 }
290 },
291 "/v1/example/echo_internal_and_preview": {
292 "get": {
293 "summary": "EchoInternalAndPreview is a internal and preview API that should only be visible in the OpenAPI spec\nif `visibility_restriction_selectors` includes \"PREVIEW\" or \"INTERNAL\".",
294 "operationId": "VisibilityRuleEchoService_EchoInternalAndPreview",
295 "responses": {
296 "200": {
297 "description": "A successful response.",
298 "schema": {
299 "$ref": "#/definitions/examplepbVisibilityRuleSimpleMessage"
300 }
301 },
302 "default": {
303 "description": "An unexpected error response.",
304 "schema": {
305 "$ref": "#/definitions/rpcStatus"
306 }
307 }
308 },
309 "parameters": [
310 {
311 "name": "id",
312 "description": "Id represents the message identifier.",
313 "in": "query",
314 "required": false,
315 "type": "string"
316 },
317 {
318 "name": "num",
319 "in": "query",
320 "required": false,
321 "type": "string",
322 "format": "int64"
323 },
324 {
325 "name": "lineNum",
326 "in": "query",
327 "required": false,
328 "type": "string",
329 "format": "int64"
330 },
331 {
332 "name": "lang",
333 "in": "query",
334 "required": false,
335 "type": "string"
336 },
337 {
338 "name": "status.progress",
339 "in": "query",
340 "required": false,
341 "type": "string",
342 "format": "int64"
343 },
344 {
345 "name": "status.note",
346 "in": "query",
347 "required": false,
348 "type": "string"
349 },
350 {
351 "name": "status.internalField",
352 "in": "query",
353 "required": false,
354 "type": "string"
355 },
356 {
357 "name": "status.previewField",
358 "in": "query",
359 "required": false,
360 "type": "string"
361 },
362 {
363 "name": "en",
364 "in": "query",
365 "required": false,
366 "type": "string",
367 "format": "int64"
368 },
369 {
370 "name": "no.progress",
371 "in": "query",
372 "required": false,
373 "type": "string",
374 "format": "int64"
375 },
376 {
377 "name": "no.note",
378 "in": "query",
379 "required": false,
380 "type": "string"
381 },
382 {
383 "name": "no.internalField",
384 "in": "query",
385 "required": false,
386 "type": "string"
387 },
388 {
389 "name": "no.previewField",
390 "in": "query",
391 "required": false,
392 "type": "string"
393 },
394 {
395 "name": "internalField",
396 "in": "query",
397 "required": false,
398 "type": "string"
399 },
400 {
401 "name": "previewField",
402 "in": "query",
403 "required": false,
404 "type": "string"
405 },
406 {
407 "name": "anEnum",
408 "in": "query",
409 "required": false,
410 "type": "string",
411 "enum": [
412 "VISIBILITY_ENUM_UNSPECIFIED",
413 "VISIBILITY_ENUM_VISIBLE",
414 "VISIBILITY_ENUM_INTERNAL",
415 "VISIBILITY_ENUM_PREVIEW"
416 ],
417 "default": "VISIBILITY_ENUM_UNSPECIFIED"
418 }
419 ],
420 "tags": [
421 "VisibilityRuleEchoService"
422 ]
423 }
424 },
425 "/v1/example/internal/echo/{id}": {
426 "post": {
427 "summary": "Echo method receives a simple message and returns it.\nIt should not be visible in the open API output.",
428 "operationId": "VisibilityRuleInternalEchoService_Echo",
429 "responses": {
430 "200": {
431 "description": "A successful response.",
432 "schema": {
433 "$ref": "#/definitions/examplepbVisibilityRuleSimpleMessage"
434 }
435 },
436 "default": {
437 "description": "An unexpected error response.",
438 "schema": {
439 "$ref": "#/definitions/rpcStatus"
440 }
441 }
442 },
443 "parameters": [
444 {
445 "name": "id",
446 "description": "Id represents the message identifier.",
447 "in": "path",
448 "required": true,
449 "type": "string"
450 },
451 {
452 "name": "num",
453 "in": "query",
454 "required": false,
455 "type": "string",
456 "format": "int64"
457 },
458 {
459 "name": "lineNum",
460 "in": "query",
461 "required": false,
462 "type": "string",
463 "format": "int64"
464 },
465 {
466 "name": "lang",
467 "in": "query",
468 "required": false,
469 "type": "string"
470 },
471 {
472 "name": "status.progress",
473 "in": "query",
474 "required": false,
475 "type": "string",
476 "format": "int64"
477 },
478 {
479 "name": "status.note",
480 "in": "query",
481 "required": false,
482 "type": "string"
483 },
484 {
485 "name": "status.internalField",
486 "in": "query",
487 "required": false,
488 "type": "string"
489 },
490 {
491 "name": "status.previewField",
492 "in": "query",
493 "required": false,
494 "type": "string"
495 },
496 {
497 "name": "en",
498 "in": "query",
499 "required": false,
500 "type": "string",
501 "format": "int64"
502 },
503 {
504 "name": "no.progress",
505 "in": "query",
506 "required": false,
507 "type": "string",
508 "format": "int64"
509 },
510 {
511 "name": "no.note",
512 "in": "query",
513 "required": false,
514 "type": "string"
515 },
516 {
517 "name": "no.internalField",
518 "in": "query",
519 "required": false,
520 "type": "string"
521 },
522 {
523 "name": "no.previewField",
524 "in": "query",
525 "required": false,
526 "type": "string"
527 },
528 {
529 "name": "internalField",
530 "in": "query",
531 "required": false,
532 "type": "string"
533 },
534 {
535 "name": "previewField",
536 "in": "query",
537 "required": false,
538 "type": "string"
539 },
540 {
541 "name": "anEnum",
542 "in": "query",
543 "required": false,
544 "type": "string",
545 "enum": [
546 "VISIBILITY_ENUM_UNSPECIFIED",
547 "VISIBILITY_ENUM_VISIBLE",
548 "VISIBILITY_ENUM_INTERNAL",
549 "VISIBILITY_ENUM_PREVIEW"
550 ],
551 "default": "VISIBILITY_ENUM_UNSPECIFIED"
552 }
553 ],
554 "tags": [
555 "VisibilityRuleInternalEchoService"
556 ]
557 }
558 }
559 },
560 "definitions": {
561 "VisibilityRuleSimpleMessageVisibilityEnum": {
562 "type": "string",
563 "enum": [
564 "VISIBILITY_ENUM_UNSPECIFIED",
565 "VISIBILITY_ENUM_VISIBLE",
566 "VISIBILITY_ENUM_INTERNAL",
567 "VISIBILITY_ENUM_PREVIEW"
568 ],
569 "default": "VISIBILITY_ENUM_UNSPECIFIED"
570 },
571 "examplepbVisibilityRuleEmbedded": {
572 "type": "object",
573 "properties": {
574 "progress": {
575 "type": "string",
576 "format": "int64"
577 },
578 "note": {
579 "type": "string"
580 },
581 "internalField": {
582 "type": "string"
583 },
584 "previewField": {
585 "type": "string"
586 }
587 },
588 "description": "Embedded represents a message embedded in SimpleMessage."
589 },
590 "examplepbVisibilityRuleSimpleMessage": {
591 "type": "object",
592 "properties": {
593 "id": {
594 "type": "string",
595 "description": "Id represents the message identifier."
596 },
597 "num": {
598 "type": "string",
599 "format": "int64"
600 },
601 "lineNum": {
602 "type": "string",
603 "format": "int64"
604 },
605 "lang": {
606 "type": "string"
607 },
608 "status": {
609 "$ref": "#/definitions/examplepbVisibilityRuleEmbedded"
610 },
611 "en": {
612 "type": "string",
613 "format": "int64"
614 },
615 "no": {
616 "$ref": "#/definitions/examplepbVisibilityRuleEmbedded"
617 },
618 "internalField": {
619 "type": "string"
620 },
621 "previewField": {
622 "type": "string"
623 },
624 "anEnum": {
625 "$ref": "#/definitions/VisibilityRuleSimpleMessageVisibilityEnum"
626 }
627 },
628 "description": "SimpleMessage represents a simple message sent to the Echo service."
629 },
630 "protobufAny": {
631 "type": "object",
632 "properties": {
633 "@type": {
634 "type": "string"
635 }
636 },
637 "additionalProperties": {}
638 },
639 "rpcStatus": {
640 "type": "object",
641 "properties": {
642 "code": {
643 "type": "integer",
644 "format": "int32"
645 },
646 "message": {
647 "type": "string"
648 },
649 "details": {
650 "type": "array",
651 "items": {
652 "type": "object",
653 "$ref": "#/definitions/protobufAny"
654 }
655 }
656 }
657 }
658 }
659}
View as plain text