...

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

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

View as plain text