...

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

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

     1---
     2swagger: "2.0"
     3info:
     4  description: "Echo Service API consists of a single service which returns\na message."
     5  version: "version not set"
     6  title: "Echo Service"
     7consumes:
     8- "application/json"
     9produces:
    10- "application/json"
    11paths:
    12  /v1/example/echo/{id}:
    13    post:
    14      tags:
    15      - "EchoService"
    16      summary: "Echo method receives a simple message and returns it."
    17      description: "The message posted as the id parameter will also be\nreturned."
    18      operationId: "EchoService_Echo"
    19      parameters:
    20      - name: "id"
    21        in: "path"
    22        description: "Id represents the message identifier."
    23        required: true
    24        type: "string"
    25        x-exportParamName: "Id"
    26      responses:
    27        200:
    28          description: "A successful response."
    29          schema:
    30            $ref: "#/definitions/examplepbSimpleMessage"
    31        default:
    32          description: "An unexpected error response."
    33          schema:
    34            $ref: "#/definitions/runtimeError"
    35  /v1/example/echo/{id}/{num}:
    36    get:
    37      tags:
    38      - "EchoService"
    39      summary: "Echo method receives a simple message and returns it."
    40      description: "The message posted as the id parameter will also be\nreturned."
    41      operationId: "EchoService_Echo2"
    42      parameters:
    43      - name: "id"
    44        in: "path"
    45        description: "Id represents the message identifier."
    46        required: true
    47        type: "string"
    48        x-exportParamName: "Id"
    49      - name: "num"
    50        in: "path"
    51        required: true
    52        type: "string"
    53        format: "int64"
    54        x-exportParamName: "Num"
    55      - name: "line_num"
    56        in: "query"
    57        required: false
    58        type: "string"
    59        format: "int64"
    60        x-exportParamName: "LineNum"
    61        x-optionalDataType: "String"
    62      - name: "lang"
    63        in: "query"
    64        required: false
    65        type: "string"
    66        x-exportParamName: "Lang"
    67        x-optionalDataType: "String"
    68      - name: "status.progress"
    69        in: "query"
    70        required: false
    71        type: "string"
    72        format: "int64"
    73        x-exportParamName: "StatusProgress"
    74        x-optionalDataType: "String"
    75      - name: "status.note"
    76        in: "query"
    77        required: false
    78        type: "string"
    79        x-exportParamName: "StatusNote"
    80        x-optionalDataType: "String"
    81      - name: "en"
    82        in: "query"
    83        required: false
    84        type: "string"
    85        format: "int64"
    86        x-exportParamName: "En"
    87        x-optionalDataType: "String"
    88      - name: "no.progress"
    89        in: "query"
    90        required: false
    91        type: "string"
    92        format: "int64"
    93        x-exportParamName: "NoProgress"
    94        x-optionalDataType: "String"
    95      - name: "no.note"
    96        in: "query"
    97        required: false
    98        type: "string"
    99        x-exportParamName: "NoNote"
   100        x-optionalDataType: "String"
   101      responses:
   102        200:
   103          description: "A successful response."
   104          schema:
   105            $ref: "#/definitions/examplepbSimpleMessage"
   106        default:
   107          description: "An unexpected error response."
   108          schema:
   109            $ref: "#/definitions/runtimeError"
   110  /v1/example/echo/{id}/{num}/{lang}:
   111    get:
   112      tags:
   113      - "EchoService"
   114      summary: "Echo method receives a simple message and returns it."
   115      description: "The message posted as the id parameter will also be\nreturned."
   116      operationId: "EchoService_Echo3"
   117      parameters:
   118      - name: "id"
   119        in: "path"
   120        description: "Id represents the message identifier."
   121        required: true
   122        type: "string"
   123        x-exportParamName: "Id"
   124      - name: "num"
   125        in: "path"
   126        required: true
   127        type: "string"
   128        format: "int64"
   129        x-exportParamName: "Num"
   130      - name: "lang"
   131        in: "path"
   132        required: true
   133        type: "string"
   134        x-exportParamName: "Lang"
   135      - name: "line_num"
   136        in: "query"
   137        required: false
   138        type: "string"
   139        format: "int64"
   140        x-exportParamName: "LineNum"
   141        x-optionalDataType: "String"
   142      - name: "status.progress"
   143        in: "query"
   144        required: false
   145        type: "string"
   146        format: "int64"
   147        x-exportParamName: "StatusProgress"
   148        x-optionalDataType: "String"
   149      - name: "status.note"
   150        in: "query"
   151        required: false
   152        type: "string"
   153        x-exportParamName: "StatusNote"
   154        x-optionalDataType: "String"
   155      - name: "en"
   156        in: "query"
   157        required: false
   158        type: "string"
   159        format: "int64"
   160        x-exportParamName: "En"
   161        x-optionalDataType: "String"
   162      - name: "no.progress"
   163        in: "query"
   164        required: false
   165        type: "string"
   166        format: "int64"
   167        x-exportParamName: "NoProgress"
   168        x-optionalDataType: "String"
   169      - name: "no.note"
   170        in: "query"
   171        required: false
   172        type: "string"
   173        x-exportParamName: "NoNote"
   174        x-optionalDataType: "String"
   175      responses:
   176        200:
   177          description: "A successful response."
   178          schema:
   179            $ref: "#/definitions/examplepbSimpleMessage"
   180        default:
   181          description: "An unexpected error response."
   182          schema:
   183            $ref: "#/definitions/runtimeError"
   184  /v1/example/echo1/{id}/{line_num}/{status.note}:
   185    get:
   186      tags:
   187      - "EchoService"
   188      summary: "Echo method receives a simple message and returns it."
   189      description: "The message posted as the id parameter will also be\nreturned."
   190      operationId: "EchoService_Echo4"
   191      parameters:
   192      - name: "id"
   193        in: "path"
   194        description: "Id represents the message identifier."
   195        required: true
   196        type: "string"
   197        x-exportParamName: "Id"
   198      - name: "line_num"
   199        in: "path"
   200        required: true
   201        type: "string"
   202        format: "int64"
   203        x-exportParamName: "LineNum"
   204      - name: "status.note"
   205        in: "path"
   206        required: true
   207        type: "string"
   208        x-exportParamName: "StatusNote"
   209      - name: "num"
   210        in: "query"
   211        required: false
   212        type: "string"
   213        format: "int64"
   214        x-exportParamName: "Num"
   215        x-optionalDataType: "String"
   216      - name: "lang"
   217        in: "query"
   218        required: false
   219        type: "string"
   220        x-exportParamName: "Lang"
   221        x-optionalDataType: "String"
   222      - name: "status.progress"
   223        in: "query"
   224        required: false
   225        type: "string"
   226        format: "int64"
   227        x-exportParamName: "StatusProgress"
   228        x-optionalDataType: "String"
   229      - name: "en"
   230        in: "query"
   231        required: false
   232        type: "string"
   233        format: "int64"
   234        x-exportParamName: "En"
   235        x-optionalDataType: "String"
   236      - name: "no.progress"
   237        in: "query"
   238        required: false
   239        type: "string"
   240        format: "int64"
   241        x-exportParamName: "NoProgress"
   242        x-optionalDataType: "String"
   243      responses:
   244        200:
   245          description: "A successful response."
   246          schema:
   247            $ref: "#/definitions/examplepbSimpleMessage"
   248        default:
   249          description: "An unexpected error response."
   250          schema:
   251            $ref: "#/definitions/runtimeError"
   252  /v1/example/echo2/{no.note}:
   253    get:
   254      tags:
   255      - "EchoService"
   256      summary: "Echo method receives a simple message and returns it."
   257      description: "The message posted as the id parameter will also be\nreturned."
   258      operationId: "EchoService_Echo5"
   259      parameters:
   260      - name: "no.note"
   261        in: "path"
   262        required: true
   263        type: "string"
   264        x-exportParamName: "NoNote"
   265      - name: "id"
   266        in: "query"
   267        description: "Id represents the message identifier."
   268        required: false
   269        type: "string"
   270        x-exportParamName: "Id"
   271        x-optionalDataType: "String"
   272      - name: "num"
   273        in: "query"
   274        required: false
   275        type: "string"
   276        format: "int64"
   277        x-exportParamName: "Num"
   278        x-optionalDataType: "String"
   279      - name: "line_num"
   280        in: "query"
   281        required: false
   282        type: "string"
   283        format: "int64"
   284        x-exportParamName: "LineNum"
   285        x-optionalDataType: "String"
   286      - name: "lang"
   287        in: "query"
   288        required: false
   289        type: "string"
   290        x-exportParamName: "Lang"
   291        x-optionalDataType: "String"
   292      - name: "status.progress"
   293        in: "query"
   294        required: false
   295        type: "string"
   296        format: "int64"
   297        x-exportParamName: "StatusProgress"
   298        x-optionalDataType: "String"
   299      - name: "en"
   300        in: "query"
   301        required: false
   302        type: "string"
   303        format: "int64"
   304        x-exportParamName: "En"
   305        x-optionalDataType: "String"
   306      - name: "no.progress"
   307        in: "query"
   308        required: false
   309        type: "string"
   310        format: "int64"
   311        x-exportParamName: "NoProgress"
   312        x-optionalDataType: "String"
   313      responses:
   314        200:
   315          description: "A successful response."
   316          schema:
   317            $ref: "#/definitions/examplepbSimpleMessage"
   318        default:
   319          description: "An unexpected error response."
   320          schema:
   321            $ref: "#/definitions/runtimeError"
   322  /v1/example/echo_body:
   323    post:
   324      tags:
   325      - "EchoService"
   326      summary: "EchoBody method receives a simple message and returns it."
   327      operationId: "EchoService_EchoBody"
   328      parameters:
   329      - in: "body"
   330        name: "body"
   331        required: true
   332        schema:
   333          $ref: "#/definitions/examplepbSimpleMessage"
   334        x-exportParamName: "Body"
   335      responses:
   336        200:
   337          description: "A successful response."
   338          schema:
   339            $ref: "#/definitions/examplepbSimpleMessage"
   340        default:
   341          description: "An unexpected error response."
   342          schema:
   343            $ref: "#/definitions/runtimeError"
   344  /v1/example/echo_delete:
   345    delete:
   346      tags:
   347      - "EchoService"
   348      summary: "EchoDelete method receives a simple message and returns it."
   349      operationId: "EchoService_EchoDelete"
   350      parameters:
   351      - name: "id"
   352        in: "query"
   353        description: "Id represents the message identifier."
   354        required: false
   355        type: "string"
   356        x-exportParamName: "Id"
   357        x-optionalDataType: "String"
   358      - name: "num"
   359        in: "query"
   360        required: false
   361        type: "string"
   362        format: "int64"
   363        x-exportParamName: "Num"
   364        x-optionalDataType: "String"
   365      - name: "line_num"
   366        in: "query"
   367        required: false
   368        type: "string"
   369        format: "int64"
   370        x-exportParamName: "LineNum"
   371        x-optionalDataType: "String"
   372      - name: "lang"
   373        in: "query"
   374        required: false
   375        type: "string"
   376        x-exportParamName: "Lang"
   377        x-optionalDataType: "String"
   378      - name: "status.progress"
   379        in: "query"
   380        required: false
   381        type: "string"
   382        format: "int64"
   383        x-exportParamName: "StatusProgress"
   384        x-optionalDataType: "String"
   385      - name: "status.note"
   386        in: "query"
   387        required: false
   388        type: "string"
   389        x-exportParamName: "StatusNote"
   390        x-optionalDataType: "String"
   391      - name: "en"
   392        in: "query"
   393        required: false
   394        type: "string"
   395        format: "int64"
   396        x-exportParamName: "En"
   397        x-optionalDataType: "String"
   398      - name: "no.progress"
   399        in: "query"
   400        required: false
   401        type: "string"
   402        format: "int64"
   403        x-exportParamName: "NoProgress"
   404        x-optionalDataType: "String"
   405      - name: "no.note"
   406        in: "query"
   407        required: false
   408        type: "string"
   409        x-exportParamName: "NoNote"
   410        x-optionalDataType: "String"
   411      responses:
   412        200:
   413          description: "A successful response."
   414          schema:
   415            $ref: "#/definitions/examplepbSimpleMessage"
   416        default:
   417          description: "An unexpected error response."
   418          schema:
   419            $ref: "#/definitions/runtimeError"
   420definitions:
   421  examplepbEmbedded:
   422    type: "object"
   423    properties:
   424      progress:
   425        type: "string"
   426        format: "int64"
   427      note:
   428        type: "string"
   429    description: "Embedded represents a message embedded in SimpleMessage."
   430    example:
   431      note: "note"
   432      progress: "progress"
   433  examplepbSimpleMessage:
   434    type: "object"
   435    properties:
   436      id:
   437        type: "string"
   438        description: "Id represents the message identifier."
   439      num:
   440        type: "string"
   441        format: "int64"
   442      line_num:
   443        type: "string"
   444        format: "int64"
   445      lang:
   446        type: "string"
   447      status:
   448        $ref: "#/definitions/examplepbEmbedded"
   449      en:
   450        type: "string"
   451        format: "int64"
   452      "no":
   453        $ref: "#/definitions/examplepbEmbedded"
   454    description: "SimpleMessage represents a simple message sent to the Echo service."
   455    example:
   456      "no":
   457        note: "note"
   458        progress: "progress"
   459      line_num: "line_num"
   460      num: "num"
   461      en: "en"
   462      id: "id"
   463      lang: "lang"
   464      status:
   465        note: "note"
   466        progress: "progress"
   467  protobufAny:
   468    type: "object"
   469    properties:
   470      type_url:
   471        type: "string"
   472        description: "A URL/resource name that uniquely identifies the type of the\
   473          \ serialized\nprotocol buffer message. This string must contain at least\n\
   474          one \"/\" character. The last segment of the URL's path must represent\n\
   475          the fully qualified name of the type (as in\n`path/google.protobuf.Duration`).\
   476          \ The name should be in a canonical form\n(e.g., leading \".\" is not accepted).\n\
   477          \nIn practice, teams usually precompile into the binary all types that they\n\
   478          expect it to use in the context of Any. However, for URLs which use the\n\
   479          scheme `http`, `https`, or no scheme, one can optionally set up a type\n\
   480          server that maps type URLs to message definitions as follows:\n\n* If no\
   481          \ scheme is provided, `https` is assumed.\n* An HTTP GET on the URL must\
   482          \ yield a [google.protobuf.Type][]\n  value in binary format, or produce\
   483          \ an error.\n* Applications are allowed to cache lookup results based on\
   484          \ the\n  URL, or have them precompiled into a binary to avoid any\n  lookup.\
   485          \ Therefore, binary compatibility needs to be preserved\n  on changes to\
   486          \ types. (Use versioned type names to manage\n  breaking changes.)\n\nNote:\
   487          \ this functionality is not currently available in the official\nprotobuf\
   488          \ release, and it is not used for type URLs beginning with\ntype.googleapis.com.\n\
   489          \nSchemes other than `http`, `https` (or the empty scheme) might be\nused\
   490          \ with implementation specific semantics."
   491      value:
   492        type: "string"
   493        format: "byte"
   494        description: "Must be a valid serialized protocol buffer of the above specified\
   495          \ type."
   496        pattern: "^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$"
   497    description: "`Any` contains an arbitrary serialized protocol buffer message along\
   498      \ with a\nURL that describes the type of the serialized message.\n\nProtobuf\
   499      \ library provides support to pack/unpack Any values in the form\nof utility\
   500      \ functions or additional generated methods of the Any type.\n\nExample 1: Pack\
   501      \ and unpack a message in C++.\n\n    Foo foo = ...;\n    Any any;\n    any.PackFrom(foo);\n\
   502      \    ...\n    if (any.UnpackTo(&foo)) {\n      ...\n    }\n\nExample 2: Pack\
   503      \ and unpack a message in Java.\n\n    Foo foo = ...;\n    Any any = Any.pack(foo);\n\
   504      \    ...\n    if (any.is(Foo.class)) {\n      foo = any.unpack(Foo.class);\n\
   505      \    }\n\n Example 3: Pack and unpack a message in Python.\n\n    foo = Foo(...)\n\
   506      \    any = Any()\n    any.Pack(foo)\n    ...\n    if any.Is(Foo.DESCRIPTOR):\n\
   507      \      any.Unpack(foo)\n      ...\n\n Example 4: Pack and unpack a message in\
   508      \ Go\n\n     foo := &pb.Foo{...}\n     any, err := ptypes.MarshalAny(foo)\n\
   509      \     ...\n     foo := &pb.Foo{}\n     if err := ptypes.UnmarshalAny(any, foo);\
   510      \ err != nil {\n       ...\n     }\n\nThe pack methods provided by protobuf\
   511      \ library will by default use\n'type.googleapis.com/full.type.name' as the type\
   512      \ URL and the unpack\nmethods only use the fully qualified type name after the\
   513      \ last '/'\nin the type URL, for example \"foo.bar.com/x/y.z\" will yield type\n\
   514      name \"y.z\".\n\n\nJSON\n====\nThe JSON representation of an `Any` value uses\
   515      \ the regular\nrepresentation of the deserialized, embedded message, with an\n\
   516      additional field `@type` which contains the type URL. Example:\n\n    package\
   517      \ google.profile;\n    message Person {\n      string first_name = 1;\n    \
   518      \  string last_name = 2;\n    }\n\n    {\n      \"@type\": \"type.googleapis.com/google.profile.Person\"\
   519      ,\n      \"firstName\": <string>,\n      \"lastName\": <string>\n    }\n\nIf\
   520      \ the embedded message type is well-known and has a custom JSON\nrepresentation,\
   521      \ that representation will be embedded adding a field\n`value` which holds the\
   522      \ custom JSON in addition to the `@type`\nfield. Example (for message [google.protobuf.Duration][]):\n\
   523      \n    {\n      \"@type\": \"type.googleapis.com/google.protobuf.Duration\",\n\
   524      \      \"value\": \"1.212s\"\n    }"
   525  runtimeError:
   526    type: "object"
   527    properties:
   528      error:
   529        type: "string"
   530      code:
   531        type: "integer"
   532        format: "int32"
   533      message:
   534        type: "string"
   535      details:
   536        type: "array"
   537        items:
   538          $ref: "#/definitions/protobufAny"

View as plain text