...

Text file src/github.com/grpc-ecosystem/grpc-gateway/examples/internal/clients/responsebody/api/swagger.yaml

Documentation: github.com/grpc-ecosystem/grpc-gateway/examples/internal/clients/responsebody/api

     1---
     2swagger: "2.0"
     3info:
     4  version: "version not set"
     5  title: "examples/internal/proto/examplepb/response_body_service.proto"
     6consumes:
     7- "application/json"
     8produces:
     9- "application/json"
    10paths:
    11  /responsebodies/{data}:
    12    get:
    13      tags:
    14      - "ResponseBodyService"
    15      operationId: "ResponseBodyService_ListResponseBodies"
    16      parameters:
    17      - name: "data"
    18        in: "path"
    19        required: true
    20        type: "string"
    21        x-exportParamName: "Data"
    22      responses:
    23        200:
    24          description: ""
    25          schema:
    26            type: "array"
    27            items:
    28              $ref: "#/definitions/examplepbRepeatedResponseBodyOutResponse"
    29        default:
    30          description: "An unexpected error response."
    31          schema:
    32            $ref: "#/definitions/runtimeError"
    33  /responsebody/stream/{data}:
    34    get:
    35      tags:
    36      - "ResponseBodyService"
    37      operationId: "ResponseBodyService_GetResponseBodyStream"
    38      parameters:
    39      - name: "data"
    40        in: "path"
    41        required: true
    42        type: "string"
    43        x-exportParamName: "Data"
    44      responses:
    45        200:
    46          description: "(streaming responses)"
    47          schema:
    48            type: "object"
    49            properties:
    50              result:
    51                $ref: "#/definitions/examplepbResponseBodyOutResponse"
    52              error:
    53                $ref: "#/definitions/runtimeStreamError"
    54            title: "Stream result of examplepbResponseBodyOut"
    55        default:
    56          description: "An unexpected error response."
    57          schema:
    58            $ref: "#/definitions/runtimeError"
    59  /responsebody/{data}:
    60    get:
    61      tags:
    62      - "ResponseBodyService"
    63      operationId: "ResponseBodyService_GetResponseBody"
    64      parameters:
    65      - name: "data"
    66        in: "path"
    67        required: true
    68        type: "string"
    69        x-exportParamName: "Data"
    70      responses:
    71        200:
    72          description: ""
    73          schema:
    74            $ref: "#/definitions/examplepbResponseBodyOutResponse"
    75        default:
    76          description: "An unexpected error response."
    77          schema:
    78            $ref: "#/definitions/runtimeError"
    79  /responsestrings/{data}:
    80    get:
    81      tags:
    82      - "ResponseBodyService"
    83      operationId: "ResponseBodyService_ListResponseStrings"
    84      parameters:
    85      - name: "data"
    86        in: "path"
    87        required: true
    88        type: "string"
    89        x-exportParamName: "Data"
    90      responses:
    91        200:
    92          description: ""
    93          schema:
    94            type: "array"
    95            items:
    96              type: "string"
    97        default:
    98          description: "An unexpected error response."
    99          schema:
   100            $ref: "#/definitions/runtimeError"
   101definitions:
   102  ResponseResponseType:
   103    type: "string"
   104    title: "- UNKNOWN: UNKNOWN\n - A: A is 1\n - B: B is 2"
   105    enum:
   106    - "UNKNOWN"
   107    - "A"
   108    - "B"
   109    default: "UNKNOWN"
   110  examplepbRepeatedResponseBodyOut:
   111    type: "object"
   112    properties:
   113      response:
   114        type: "array"
   115        items:
   116          $ref: "#/definitions/examplepbRepeatedResponseBodyOutResponse"
   117  examplepbRepeatedResponseBodyOutResponse:
   118    type: "object"
   119    properties:
   120      data:
   121        type: "string"
   122      type:
   123        $ref: "#/definitions/ResponseResponseType"
   124    example:
   125      data: "data"
   126      type: {}
   127  examplepbRepeatedResponseStrings:
   128    type: "object"
   129    properties:
   130      values:
   131        type: "array"
   132        items:
   133          type: "string"
   134  examplepbResponseBodyOut:
   135    type: "object"
   136    properties:
   137      response:
   138        $ref: "#/definitions/examplepbResponseBodyOutResponse"
   139  examplepbResponseBodyOutResponse:
   140    type: "object"
   141    properties:
   142      data:
   143        type: "string"
   144    example:
   145      data: "data"
   146  protobufAny:
   147    type: "object"
   148    properties:
   149      type_url:
   150        type: "string"
   151        description: "A URL/resource name that uniquely identifies the type of the\
   152          \ serialized\nprotocol buffer message. This string must contain at least\n\
   153          one \"/\" character. The last segment of the URL's path must represent\n\
   154          the fully qualified name of the type (as in\n`path/google.protobuf.Duration`).\
   155          \ The name should be in a canonical form\n(e.g., leading \".\" is not accepted).\n\
   156          \nIn practice, teams usually precompile into the binary all types that they\n\
   157          expect it to use in the context of Any. However, for URLs which use the\n\
   158          scheme `http`, `https`, or no scheme, one can optionally set up a type\n\
   159          server that maps type URLs to message definitions as follows:\n\n* If no\
   160          \ scheme is provided, `https` is assumed.\n* An HTTP GET on the URL must\
   161          \ yield a [google.protobuf.Type][]\n  value in binary format, or produce\
   162          \ an error.\n* Applications are allowed to cache lookup results based on\
   163          \ the\n  URL, or have them precompiled into a binary to avoid any\n  lookup.\
   164          \ Therefore, binary compatibility needs to be preserved\n  on changes to\
   165          \ types. (Use versioned type names to manage\n  breaking changes.)\n\nNote:\
   166          \ this functionality is not currently available in the official\nprotobuf\
   167          \ release, and it is not used for type URLs beginning with\ntype.googleapis.com.\n\
   168          \nSchemes other than `http`, `https` (or the empty scheme) might be\nused\
   169          \ with implementation specific semantics."
   170      value:
   171        type: "string"
   172        format: "byte"
   173        description: "Must be a valid serialized protocol buffer of the above specified\
   174          \ type."
   175        pattern: "^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$"
   176    description: "`Any` contains an arbitrary serialized protocol buffer message along\
   177      \ with a\nURL that describes the type of the serialized message.\n\nProtobuf\
   178      \ library provides support to pack/unpack Any values in the form\nof utility\
   179      \ functions or additional generated methods of the Any type.\n\nExample 1: Pack\
   180      \ and unpack a message in C++.\n\n    Foo foo = ...;\n    Any any;\n    any.PackFrom(foo);\n\
   181      \    ...\n    if (any.UnpackTo(&foo)) {\n      ...\n    }\n\nExample 2: Pack\
   182      \ and unpack a message in Java.\n\n    Foo foo = ...;\n    Any any = Any.pack(foo);\n\
   183      \    ...\n    if (any.is(Foo.class)) {\n      foo = any.unpack(Foo.class);\n\
   184      \    }\n\n Example 3: Pack and unpack a message in Python.\n\n    foo = Foo(...)\n\
   185      \    any = Any()\n    any.Pack(foo)\n    ...\n    if any.Is(Foo.DESCRIPTOR):\n\
   186      \      any.Unpack(foo)\n      ...\n\n Example 4: Pack and unpack a message in\
   187      \ Go\n\n     foo := &pb.Foo{...}\n     any, err := ptypes.MarshalAny(foo)\n\
   188      \     ...\n     foo := &pb.Foo{}\n     if err := ptypes.UnmarshalAny(any, foo);\
   189      \ err != nil {\n       ...\n     }\n\nThe pack methods provided by protobuf\
   190      \ library will by default use\n'type.googleapis.com/full.type.name' as the type\
   191      \ URL and the unpack\nmethods only use the fully qualified type name after the\
   192      \ last '/'\nin the type URL, for example \"foo.bar.com/x/y.z\" will yield type\n\
   193      name \"y.z\".\n\n\nJSON\n====\nThe JSON representation of an `Any` value uses\
   194      \ the regular\nrepresentation of the deserialized, embedded message, with an\n\
   195      additional field `@type` which contains the type URL. Example:\n\n    package\
   196      \ google.profile;\n    message Person {\n      string first_name = 1;\n    \
   197      \  string last_name = 2;\n    }\n\n    {\n      \"@type\": \"type.googleapis.com/google.profile.Person\"\
   198      ,\n      \"firstName\": <string>,\n      \"lastName\": <string>\n    }\n\nIf\
   199      \ the embedded message type is well-known and has a custom JSON\nrepresentation,\
   200      \ that representation will be embedded adding a field\n`value` which holds the\
   201      \ custom JSON in addition to the `@type`\nfield. Example (for message [google.protobuf.Duration][]):\n\
   202      \n    {\n      \"@type\": \"type.googleapis.com/google.protobuf.Duration\",\n\
   203      \      \"value\": \"1.212s\"\n    }"
   204    example:
   205      value: "value"
   206      type_url: "type_url"
   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"
   221  runtimeStreamError:
   222    type: "object"
   223    properties:
   224      grpc_code:
   225        type: "integer"
   226        format: "int32"
   227      http_code:
   228        type: "integer"
   229        format: "int32"
   230      message:
   231        type: "string"
   232      http_status:
   233        type: "string"
   234      details:
   235        type: "array"
   236        items:
   237          $ref: "#/definitions/protobufAny"
   238    example:
   239      http_code: 6
   240      http_status: "http_status"
   241      details:
   242      - value: "value"
   243        type_url: "type_url"
   244      - value: "value"
   245        type_url: "type_url"
   246      message: "message"
   247      grpc_code: 0
   248  Stream result of examplepbResponseBodyOut:
   249    properties:
   250      result:
   251        $ref: "#/definitions/examplepbResponseBodyOutResponse"
   252      error:
   253        $ref: "#/definitions/runtimeStreamError"
   254    example:
   255      result:
   256        data: "data"
   257      error:
   258        http_code: 6
   259        http_status: "http_status"
   260        details:
   261        - value: "value"
   262          type_url: "type_url"
   263        - value: "value"
   264          type_url: "type_url"
   265        message: "message"
   266        grpc_code: 0

View as plain text