github.com/grpc-ecosystem/grpc-gateway/v2@v2.19.1/examples/internal/proto/examplepb/visibility_rule_preview_echo_service.swagger.json (about) 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 "consumes": [ 14 "application/json" 15 ], 16 "produces": [ 17 "application/json" 18 ], 19 "paths": { 20 "/v1/example/echo/{id}": { 21 "post": { 22 "summary": "Echo method receives a simple message and returns it.\nIt should always be visible in the open API output.", 23 "operationId": "VisibilityRuleEchoService_Echo", 24 "responses": { 25 "200": { 26 "description": "A successful response.", 27 "schema": { 28 "$ref": "#/definitions/examplepbVisibilityRuleSimpleMessage" 29 } 30 }, 31 "default": { 32 "description": "An unexpected error response.", 33 "schema": { 34 "$ref": "#/definitions/rpcStatus" 35 } 36 } 37 }, 38 "parameters": [ 39 { 40 "name": "id", 41 "description": "Id represents the message identifier.", 42 "in": "path", 43 "required": true, 44 "type": "string" 45 }, 46 { 47 "name": "num", 48 "in": "query", 49 "required": false, 50 "type": "string", 51 "format": "int64" 52 }, 53 { 54 "name": "lineNum", 55 "in": "query", 56 "required": false, 57 "type": "string", 58 "format": "int64" 59 }, 60 { 61 "name": "lang", 62 "in": "query", 63 "required": false, 64 "type": "string" 65 }, 66 { 67 "name": "status.progress", 68 "in": "query", 69 "required": false, 70 "type": "string", 71 "format": "int64" 72 }, 73 { 74 "name": "status.note", 75 "in": "query", 76 "required": false, 77 "type": "string" 78 }, 79 { 80 "name": "status.previewField", 81 "in": "query", 82 "required": false, 83 "type": "string" 84 }, 85 { 86 "name": "en", 87 "in": "query", 88 "required": false, 89 "type": "string", 90 "format": "int64" 91 }, 92 { 93 "name": "no.progress", 94 "in": "query", 95 "required": false, 96 "type": "string", 97 "format": "int64" 98 }, 99 { 100 "name": "no.note", 101 "in": "query", 102 "required": false, 103 "type": "string" 104 }, 105 { 106 "name": "no.previewField", 107 "in": "query", 108 "required": false, 109 "type": "string" 110 }, 111 { 112 "name": "previewField", 113 "in": "query", 114 "required": false, 115 "type": "string" 116 }, 117 { 118 "name": "anEnum", 119 "in": "query", 120 "required": false, 121 "type": "string", 122 "enum": [ 123 "VISIBILITY_ENUM_UNSPECIFIED", 124 "VISIBILITY_ENUM_VISIBLE", 125 "VISIBILITY_ENUM_PREVIEW" 126 ], 127 "default": "VISIBILITY_ENUM_UNSPECIFIED" 128 } 129 ], 130 "tags": [ 131 "VisibilityRuleEchoService" 132 ] 133 } 134 }, 135 "/v1/example/echo_internal_and_preview": { 136 "get": { 137 "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\".", 138 "operationId": "VisibilityRuleEchoService_EchoInternalAndPreview", 139 "responses": { 140 "200": { 141 "description": "A successful response.", 142 "schema": { 143 "$ref": "#/definitions/examplepbVisibilityRuleSimpleMessage" 144 } 145 }, 146 "default": { 147 "description": "An unexpected error response.", 148 "schema": { 149 "$ref": "#/definitions/rpcStatus" 150 } 151 } 152 }, 153 "parameters": [ 154 { 155 "name": "id", 156 "description": "Id represents the message identifier.", 157 "in": "query", 158 "required": false, 159 "type": "string" 160 }, 161 { 162 "name": "num", 163 "in": "query", 164 "required": false, 165 "type": "string", 166 "format": "int64" 167 }, 168 { 169 "name": "lineNum", 170 "in": "query", 171 "required": false, 172 "type": "string", 173 "format": "int64" 174 }, 175 { 176 "name": "lang", 177 "in": "query", 178 "required": false, 179 "type": "string" 180 }, 181 { 182 "name": "status.progress", 183 "in": "query", 184 "required": false, 185 "type": "string", 186 "format": "int64" 187 }, 188 { 189 "name": "status.note", 190 "in": "query", 191 "required": false, 192 "type": "string" 193 }, 194 { 195 "name": "status.previewField", 196 "in": "query", 197 "required": false, 198 "type": "string" 199 }, 200 { 201 "name": "en", 202 "in": "query", 203 "required": false, 204 "type": "string", 205 "format": "int64" 206 }, 207 { 208 "name": "no.progress", 209 "in": "query", 210 "required": false, 211 "type": "string", 212 "format": "int64" 213 }, 214 { 215 "name": "no.note", 216 "in": "query", 217 "required": false, 218 "type": "string" 219 }, 220 { 221 "name": "no.previewField", 222 "in": "query", 223 "required": false, 224 "type": "string" 225 }, 226 { 227 "name": "previewField", 228 "in": "query", 229 "required": false, 230 "type": "string" 231 }, 232 { 233 "name": "anEnum", 234 "in": "query", 235 "required": false, 236 "type": "string", 237 "enum": [ 238 "VISIBILITY_ENUM_UNSPECIFIED", 239 "VISIBILITY_ENUM_VISIBLE", 240 "VISIBILITY_ENUM_PREVIEW" 241 ], 242 "default": "VISIBILITY_ENUM_UNSPECIFIED" 243 } 244 ], 245 "tags": [ 246 "VisibilityRuleEchoService" 247 ] 248 } 249 }, 250 "/v1/example/echo_preview": { 251 "get": { 252 "summary": "EchoPreview is a preview API that should only be visible in the OpenAPI spec\nif `visibility_restriction_selectors` includes \"PREVIEW\".", 253 "operationId": "VisibilityRuleEchoService_EchoPreview", 254 "responses": { 255 "200": { 256 "description": "A successful response.", 257 "schema": { 258 "$ref": "#/definitions/examplepbVisibilityRuleMessageInPreviewMethod" 259 } 260 }, 261 "default": { 262 "description": "An unexpected error response.", 263 "schema": { 264 "$ref": "#/definitions/rpcStatus" 265 } 266 } 267 }, 268 "parameters": [ 269 { 270 "name": "id", 271 "description": "Id represents the message identifier.", 272 "in": "query", 273 "required": false, 274 "type": "string" 275 }, 276 { 277 "name": "num", 278 "in": "query", 279 "required": false, 280 "type": "string", 281 "format": "int64" 282 }, 283 { 284 "name": "lineNum", 285 "in": "query", 286 "required": false, 287 "type": "string", 288 "format": "int64" 289 }, 290 { 291 "name": "lang", 292 "in": "query", 293 "required": false, 294 "type": "string" 295 }, 296 { 297 "name": "status.progress", 298 "in": "query", 299 "required": false, 300 "type": "string", 301 "format": "int64" 302 }, 303 { 304 "name": "status.note", 305 "in": "query", 306 "required": false, 307 "type": "string" 308 }, 309 { 310 "name": "status.previewField", 311 "in": "query", 312 "required": false, 313 "type": "string" 314 }, 315 { 316 "name": "en", 317 "in": "query", 318 "required": false, 319 "type": "string", 320 "format": "int64" 321 }, 322 { 323 "name": "no.progress", 324 "in": "query", 325 "required": false, 326 "type": "string", 327 "format": "int64" 328 }, 329 { 330 "name": "no.note", 331 "in": "query", 332 "required": false, 333 "type": "string" 334 }, 335 { 336 "name": "no.previewField", 337 "in": "query", 338 "required": false, 339 "type": "string" 340 }, 341 { 342 "name": "previewField", 343 "in": "query", 344 "required": false, 345 "type": "string" 346 }, 347 { 348 "name": "anEnum", 349 "in": "query", 350 "required": false, 351 "type": "string", 352 "enum": [ 353 "VISIBILITY_ENUM_UNSPECIFIED", 354 "VISIBILITY_ENUM_VISIBLE", 355 "VISIBILITY_ENUM_PREVIEW" 356 ], 357 "default": "VISIBILITY_ENUM_UNSPECIFIED" 358 } 359 ], 360 "tags": [ 361 "VisibilityRuleEchoService" 362 ] 363 } 364 } 365 }, 366 "definitions": { 367 "VisibilityRuleSimpleMessageVisibilityEnum": { 368 "type": "string", 369 "enum": [ 370 "VISIBILITY_ENUM_UNSPECIFIED", 371 "VISIBILITY_ENUM_VISIBLE", 372 "VISIBILITY_ENUM_PREVIEW" 373 ], 374 "default": "VISIBILITY_ENUM_UNSPECIFIED" 375 }, 376 "examplepbVisibilityRuleEmbedded": { 377 "type": "object", 378 "properties": { 379 "progress": { 380 "type": "string", 381 "format": "int64" 382 }, 383 "note": { 384 "type": "string" 385 }, 386 "previewField": { 387 "type": "string" 388 } 389 }, 390 "description": "Embedded represents a message embedded in SimpleMessage." 391 }, 392 "examplepbVisibilityRuleEnumInPreviewMethod": { 393 "type": "string", 394 "enum": [ 395 "VISIBILITY_RULE_ENUM_IN_PREVIEW_METHOD_UNSPECIFIED" 396 ], 397 "default": "VISIBILITY_RULE_ENUM_IN_PREVIEW_METHOD_UNSPECIFIED", 398 "description": "EnumInPreviewMethod doesn't define its own visibility restrictions,\nbut is only included in a method marked as \"PREVIEW\", so it will only\nappear if `visibility_restriction_selectors` include \"PREVIEW\"." 399 }, 400 "examplepbVisibilityRuleMessageInPreviewMethod": { 401 "type": "object", 402 "properties": { 403 "id": { 404 "type": "string" 405 }, 406 "subMessage": { 407 "$ref": "#/definitions/examplepbVisibilityRuleSubMessageInPreviewMethod" 408 }, 409 "enum": { 410 "$ref": "#/definitions/examplepbVisibilityRuleEnumInPreviewMethod" 411 } 412 }, 413 "description": "MessageInPreviewMethod doesn't define its own visibility restrictions,\nbut is only included in a method marked as \"PREVIEW\", so it will only\nappear if `visibility_restriction_selectors` include \"PREVIEW\"." 414 }, 415 "examplepbVisibilityRuleSimpleMessage": { 416 "type": "object", 417 "properties": { 418 "id": { 419 "type": "string", 420 "description": "Id represents the message identifier." 421 }, 422 "num": { 423 "type": "string", 424 "format": "int64" 425 }, 426 "lineNum": { 427 "type": "string", 428 "format": "int64" 429 }, 430 "lang": { 431 "type": "string" 432 }, 433 "status": { 434 "$ref": "#/definitions/examplepbVisibilityRuleEmbedded" 435 }, 436 "en": { 437 "type": "string", 438 "format": "int64" 439 }, 440 "no": { 441 "$ref": "#/definitions/examplepbVisibilityRuleEmbedded" 442 }, 443 "previewField": { 444 "type": "string" 445 }, 446 "anEnum": { 447 "$ref": "#/definitions/VisibilityRuleSimpleMessageVisibilityEnum" 448 } 449 }, 450 "description": "SimpleMessage represents a simple message sent to the Echo service." 451 }, 452 "examplepbVisibilityRuleSubMessageInPreviewMethod": { 453 "type": "object", 454 "properties": { 455 "id": { 456 "type": "string" 457 } 458 }, 459 "description": "SubMessageInPreviewMethod doesn't define its own visibility restrictions,\nbut is only included in a method marked as \"PREVIEW\", so it will only\nappear if `visibility_restriction_selectors` include \"PREVIEW\"." 460 }, 461 "protobufAny": { 462 "type": "object", 463 "properties": { 464 "@type": { 465 "type": "string" 466 } 467 }, 468 "additionalProperties": {} 469 }, 470 "rpcStatus": { 471 "type": "object", 472 "properties": { 473 "code": { 474 "type": "integer", 475 "format": "int32" 476 }, 477 "message": { 478 "type": "string" 479 }, 480 "details": { 481 "type": "array", 482 "items": { 483 "type": "object", 484 "$ref": "#/definitions/protobufAny" 485 } 486 } 487 } 488 } 489 } 490 }