You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: example/bookstore/v1/bookstore.swagger.json
+38-16Lines changed: 38 additions & 16 deletions
Original file line number
Diff line number
Diff line change
@@ -841,7 +841,7 @@
841
841
"200": {
842
842
"description": "A successful response.",
843
843
"schema": {
844
-
"$ref": "#/definitions/v1ArchiveBookResponse"
844
+
"$ref": "#/definitions/longrunningOperation"
845
845
}
846
846
},
847
847
"default": {
@@ -891,43 +891,65 @@
891
891
},
892
892
"description": "A Author."
893
893
},
894
+
"longrunningOperation": {
895
+
"type": "object",
896
+
"properties": {
897
+
"name": {
898
+
"type": "string",
899
+
"description": "The server-assigned name, which is only unique within the same service that\noriginally returns it. If you use the default HTTP mapping, the\n`name` should be a resource name ending with `operations/{unique_id}`."
900
+
},
901
+
"metadata": {
902
+
"$ref": "#/definitions/protobufAny",
903
+
"description": "Service-specific metadata associated with the operation. It typically\ncontains progress information and common metadata such as create time.\nSome services might not provide such metadata. Any method that returns a\nlong-running operation should document the metadata type, if any."
904
+
},
905
+
"done": {
906
+
"type": "boolean",
907
+
"description": "If the value is `false`, it means the operation is still in progress.\nIf `true`, the operation is completed, and either `error` or `response` is\navailable."
908
+
},
909
+
"error": {
910
+
"$ref": "#/definitions/rpcStatus",
911
+
"description": "The error result of the operation in case of failure or cancellation."
912
+
},
913
+
"response": {
914
+
"$ref": "#/definitions/protobufAny",
915
+
"description": "The normal response of the operation in case of success. If the original\nmethod returns no data on success, such as `Delete`, the response is\n`google.protobuf.Empty`. If the original method is standard\n`Get`/`Create`/`Update`, the response should be the resource. For other\nmethods, the response should have the type `XxxResponse`, where `Xxx`\nis the original method name. For example, if the original method name\nis `TakeSnapshot()`, the inferred response type is\n`TakeSnapshotResponse`."
916
+
}
917
+
},
918
+
"description": "This resource represents a long-running operation that is the result of a\nnetwork API call."
919
+
},
894
920
"protobufAny": {
895
921
"type": "object",
896
922
"properties": {
897
923
"@type": {
898
-
"type": "string"
924
+
"type": "string",
925
+
"description": "A URL/resource name that uniquely identifies the type of the serialized\nprotocol buffer message. This string must contain at least\none \"/\" character. The last segment of the URL's path must represent\nthe fully qualified name of the type (as in\n`path/google.protobuf.Duration`). The name should be in a canonical form\n(e.g., leading \".\" is not accepted).\n\nIn practice, teams usually precompile into the binary all types that they\nexpect it to use in the context of Any. However, for URLs which use the\nscheme `http`, `https`, or no scheme, one can optionally set up a type\nserver that maps type URLs to message definitions as follows:\n\n* If no scheme is provided, `https` is assumed.\n* An HTTP GET on the URL must yield a [google.protobuf.Type][]\n value in binary format, or produce an error.\n* Applications are allowed to cache lookup results based on the\n URL, or have them precompiled into a binary to avoid any\n lookup. Therefore, binary compatibility needs to be preserved\n on changes to types. (Use versioned type names to manage\n breaking changes.)\n\nNote: this functionality is not currently available in the official\nprotobuf release, and it is not used for type URLs beginning with\ntype.googleapis.com. As of May 2023, there are no widely used type server\nimplementations and no plans to implement one.\n\nSchemes other than `http`, `https` (or the empty scheme) might be\nused with implementation specific semantics."
899
926
}
900
927
},
901
-
"additionalProperties": {}
928
+
"additionalProperties": {},
929
+
"description": "`Any` contains an arbitrary serialized protocol buffer message along with a\nURL that describes the type of the serialized message.\n\nProtobuf library provides support to pack/unpack Any values in the form\nof utility functions or additional generated methods of the Any type.\n\nExample 1: Pack and unpack a message in C++.\n\n Foo foo = ...;\n Any any;\n any.PackFrom(foo);\n ...\n if (any.UnpackTo(\u0026foo)) {\n ...\n }\n\nExample 2: Pack and unpack a message in Java.\n\n Foo foo = ...;\n Any any = Any.pack(foo);\n ...\n if (any.is(Foo.class)) {\n foo = any.unpack(Foo.class);\n }\n // or ...\n if (any.isSameTypeAs(Foo.getDefaultInstance())) {\n foo = any.unpack(Foo.getDefaultInstance());\n }\n\n Example 3: Pack and unpack a message in Python.\n\n foo = Foo(...)\n any = Any()\n any.Pack(foo)\n ...\n if any.Is(Foo.DESCRIPTOR):\n any.Unpack(foo)\n ...\n\n Example 4: Pack and unpack a message in Go\n\n foo := \u0026pb.Foo{...}\n any, err := anypb.New(foo)\n if err != nil {\n ...\n }\n ...\n foo := \u0026pb.Foo{}\n if err := any.UnmarshalTo(foo); err != nil {\n ...\n }\n\nThe pack methods provided by protobuf library will by default use\n'type.googleapis.com/full.type.name' as the type URL and the unpack\nmethods only use the fully qualified type name after the last '/'\nin the type URL, for example \"foo.bar.com/x/y.z\" will yield type\nname \"y.z\".\n\nJSON\n====\nThe JSON representation of an `Any` value uses the regular\nrepresentation of the deserialized, embedded message, with an\nadditional field `@type` which contains the type URL. Example:\n\n package google.profile;\n message Person {\n string first_name = 1;\n string last_name = 2;\n }\n\n {\n \"@type\": \"type.googleapis.com/google.profile.Person\",\n \"firstName\": \u003cstring\u003e,\n \"lastName\": \u003cstring\u003e\n }\n\nIf the embedded message type is well-known and has a custom JSON\nrepresentation, that representation will be embedded adding a field\n`value` which holds the custom JSON in addition to the `@type`\nfield. Example (for message [google.protobuf.Duration][]):\n\n {\n \"@type\": \"type.googleapis.com/google.protobuf.Duration\",\n \"value\": \"1.212s\"\n }"
902
930
},
903
931
"rpcStatus": {
904
932
"type": "object",
905
933
"properties": {
906
934
"code": {
907
935
"type": "integer",
908
-
"format": "int32"
936
+
"format": "int32",
937
+
"description": "The status code, which should be an enum value of\n[google.rpc.Code][google.rpc.Code]."
909
938
},
910
939
"message": {
911
-
"type": "string"
940
+
"type": "string",
941
+
"description": "A developer-facing error message, which should be in English. Any\nuser-facing error message should be localized and sent in the\n[google.rpc.Status.details][google.rpc.Status.details] field, or localized\nby the client."
912
942
},
913
943
"details": {
914
944
"type": "array",
915
945
"items": {
916
946
"type": "object",
917
947
"$ref": "#/definitions/protobufAny"
918
-
}
919
-
}
920
-
}
921
-
},
922
-
"v1ArchiveBookResponse": {
923
-
"type": "object",
924
-
"properties": {
925
-
"success": {
926
-
"type": "boolean",
927
-
"description": "Field for success."
948
+
},
949
+
"description": "A list of messages that carry the error details. There is a common set of\nmessage types for APIs to use."
928
950
}
929
951
},
930
-
"title": "Response message forthe archive method"
952
+
"description": "The `Status` type defines a logical error model that is suitable for\ndifferent programming environments, including REST APIs and RPC APIs. It is\nused by [gRPC](https://github.com/grpc). Each `Status` message contains\nthree pieces of data: error code, error message, and error details.\n\nYou can find out more about this error model and how to work with it in the\n[API Design Guide](https://cloud.google.com/apis/design/errors)."
0 commit comments