From c6fce8c320b144ceed324cd4fc779cfd207d5dbd Mon Sep 17 00:00:00 2001 From: shawwang Date: Wed, 4 Mar 2020 22:36:13 +0800 Subject: [PATCH] Documentation: generate *.swagger.json using latest protoc-gen-swagger --- .../apispec/swagger/rpc.swagger.json | 273 ++++++++++++++++++ .../apispec/swagger/v3election.swagger.json | 51 ++++ .../apispec/swagger/v3lock.swagger.json | 45 +++ 3 files changed, 369 insertions(+) diff --git a/Documentation/dev-guide/apispec/swagger/rpc.swagger.json b/Documentation/dev-guide/apispec/swagger/rpc.swagger.json index fde10dc5c..412cf90c1 100644 --- a/Documentation/dev-guide/apispec/swagger/rpc.swagger.json +++ b/Documentation/dev-guide/apispec/swagger/rpc.swagger.json @@ -34,6 +34,12 @@ "schema": { "$ref": "#/definitions/etcdserverpbAuthenticateResponse" } + }, + "default": { + "description": "An unexpected error response", + "schema": { + "$ref": "#/definitions/runtimeError" + } } } } @@ -61,6 +67,12 @@ "schema": { "$ref": "#/definitions/etcdserverpbAuthDisableResponse" } + }, + "default": { + "description": "An unexpected error response", + "schema": { + "$ref": "#/definitions/runtimeError" + } } } } @@ -88,6 +100,12 @@ "schema": { "$ref": "#/definitions/etcdserverpbAuthEnableResponse" } + }, + "default": { + "description": "An unexpected error response", + "schema": { + "$ref": "#/definitions/runtimeError" + } } } } @@ -115,6 +133,12 @@ "schema": { "$ref": "#/definitions/etcdserverpbAuthRoleAddResponse" } + }, + "default": { + "description": "An unexpected error response", + "schema": { + "$ref": "#/definitions/runtimeError" + } } } } @@ -142,6 +166,12 @@ "schema": { "$ref": "#/definitions/etcdserverpbAuthRoleDeleteResponse" } + }, + "default": { + "description": "An unexpected error response", + "schema": { + "$ref": "#/definitions/runtimeError" + } } } } @@ -169,6 +199,12 @@ "schema": { "$ref": "#/definitions/etcdserverpbAuthRoleGetResponse" } + }, + "default": { + "description": "An unexpected error response", + "schema": { + "$ref": "#/definitions/runtimeError" + } } } } @@ -196,6 +232,12 @@ "schema": { "$ref": "#/definitions/etcdserverpbAuthRoleGrantPermissionResponse" } + }, + "default": { + "description": "An unexpected error response", + "schema": { + "$ref": "#/definitions/runtimeError" + } } } } @@ -223,6 +265,12 @@ "schema": { "$ref": "#/definitions/etcdserverpbAuthRoleListResponse" } + }, + "default": { + "description": "An unexpected error response", + "schema": { + "$ref": "#/definitions/runtimeError" + } } } } @@ -250,6 +298,12 @@ "schema": { "$ref": "#/definitions/etcdserverpbAuthRoleRevokePermissionResponse" } + }, + "default": { + "description": "An unexpected error response", + "schema": { + "$ref": "#/definitions/runtimeError" + } } } } @@ -277,6 +331,12 @@ "schema": { "$ref": "#/definitions/etcdserverpbAuthStatusResponse" } + }, + "default": { + "description": "An unexpected error response", + "schema": { + "$ref": "#/definitions/runtimeError" + } } } } @@ -304,6 +364,12 @@ "schema": { "$ref": "#/definitions/etcdserverpbAuthUserAddResponse" } + }, + "default": { + "description": "An unexpected error response", + "schema": { + "$ref": "#/definitions/runtimeError" + } } } } @@ -331,6 +397,12 @@ "schema": { "$ref": "#/definitions/etcdserverpbAuthUserChangePasswordResponse" } + }, + "default": { + "description": "An unexpected error response", + "schema": { + "$ref": "#/definitions/runtimeError" + } } } } @@ -358,6 +430,12 @@ "schema": { "$ref": "#/definitions/etcdserverpbAuthUserDeleteResponse" } + }, + "default": { + "description": "An unexpected error response", + "schema": { + "$ref": "#/definitions/runtimeError" + } } } } @@ -385,6 +463,12 @@ "schema": { "$ref": "#/definitions/etcdserverpbAuthUserGetResponse" } + }, + "default": { + "description": "An unexpected error response", + "schema": { + "$ref": "#/definitions/runtimeError" + } } } } @@ -412,6 +496,12 @@ "schema": { "$ref": "#/definitions/etcdserverpbAuthUserGrantRoleResponse" } + }, + "default": { + "description": "An unexpected error response", + "schema": { + "$ref": "#/definitions/runtimeError" + } } } } @@ -439,6 +529,12 @@ "schema": { "$ref": "#/definitions/etcdserverpbAuthUserListResponse" } + }, + "default": { + "description": "An unexpected error response", + "schema": { + "$ref": "#/definitions/runtimeError" + } } } } @@ -466,6 +562,12 @@ "schema": { "$ref": "#/definitions/etcdserverpbAuthUserRevokeRoleResponse" } + }, + "default": { + "description": "An unexpected error response", + "schema": { + "$ref": "#/definitions/runtimeError" + } } } } @@ -493,6 +595,12 @@ "schema": { "$ref": "#/definitions/etcdserverpbMemberAddResponse" } + }, + "default": { + "description": "An unexpected error response", + "schema": { + "$ref": "#/definitions/runtimeError" + } } } } @@ -520,6 +628,12 @@ "schema": { "$ref": "#/definitions/etcdserverpbMemberListResponse" } + }, + "default": { + "description": "An unexpected error response", + "schema": { + "$ref": "#/definitions/runtimeError" + } } } } @@ -547,6 +661,12 @@ "schema": { "$ref": "#/definitions/etcdserverpbMemberPromoteResponse" } + }, + "default": { + "description": "An unexpected error response", + "schema": { + "$ref": "#/definitions/runtimeError" + } } } } @@ -574,6 +694,12 @@ "schema": { "$ref": "#/definitions/etcdserverpbMemberRemoveResponse" } + }, + "default": { + "description": "An unexpected error response", + "schema": { + "$ref": "#/definitions/runtimeError" + } } } } @@ -601,6 +727,12 @@ "schema": { "$ref": "#/definitions/etcdserverpbMemberUpdateResponse" } + }, + "default": { + "description": "An unexpected error response", + "schema": { + "$ref": "#/definitions/runtimeError" + } } } } @@ -628,6 +760,12 @@ "schema": { "$ref": "#/definitions/etcdserverpbCompactionResponse" } + }, + "default": { + "description": "An unexpected error response", + "schema": { + "$ref": "#/definitions/runtimeError" + } } } } @@ -655,6 +793,12 @@ "schema": { "$ref": "#/definitions/etcdserverpbDeleteRangeResponse" } + }, + "default": { + "description": "An unexpected error response", + "schema": { + "$ref": "#/definitions/runtimeError" + } } } } @@ -682,6 +826,12 @@ "schema": { "$ref": "#/definitions/etcdserverpbLeaseLeasesResponse" } + }, + "default": { + "description": "An unexpected error response", + "schema": { + "$ref": "#/definitions/runtimeError" + } } } } @@ -709,6 +859,12 @@ "schema": { "$ref": "#/definitions/etcdserverpbLeaseRevokeResponse" } + }, + "default": { + "description": "An unexpected error response", + "schema": { + "$ref": "#/definitions/runtimeError" + } } } } @@ -736,6 +892,12 @@ "schema": { "$ref": "#/definitions/etcdserverpbLeaseTimeToLiveResponse" } + }, + "default": { + "description": "An unexpected error response", + "schema": { + "$ref": "#/definitions/runtimeError" + } } } } @@ -763,6 +925,12 @@ "schema": { "$ref": "#/definitions/etcdserverpbPutResponse" } + }, + "default": { + "description": "An unexpected error response", + "schema": { + "$ref": "#/definitions/runtimeError" + } } } } @@ -790,6 +958,12 @@ "schema": { "$ref": "#/definitions/etcdserverpbRangeResponse" } + }, + "default": { + "description": "An unexpected error response", + "schema": { + "$ref": "#/definitions/runtimeError" + } } } } @@ -817,6 +991,12 @@ "schema": { "$ref": "#/definitions/etcdserverpbTxnResponse" } + }, + "default": { + "description": "An unexpected error response", + "schema": { + "$ref": "#/definitions/runtimeError" + } } } } @@ -844,6 +1024,12 @@ "schema": { "$ref": "#/definitions/etcdserverpbLeaseGrantResponse" } + }, + "default": { + "description": "An unexpected error response", + "schema": { + "$ref": "#/definitions/runtimeError" + } } } } @@ -881,6 +1067,12 @@ } } } + }, + "default": { + "description": "An unexpected error response", + "schema": { + "$ref": "#/definitions/runtimeError" + } } } } @@ -908,6 +1100,12 @@ "schema": { "$ref": "#/definitions/etcdserverpbLeaseLeasesResponse" } + }, + "default": { + "description": "An unexpected error response", + "schema": { + "$ref": "#/definitions/runtimeError" + } } } } @@ -935,6 +1133,12 @@ "schema": { "$ref": "#/definitions/etcdserverpbLeaseRevokeResponse" } + }, + "default": { + "description": "An unexpected error response", + "schema": { + "$ref": "#/definitions/runtimeError" + } } } } @@ -962,6 +1166,12 @@ "schema": { "$ref": "#/definitions/etcdserverpbLeaseTimeToLiveResponse" } + }, + "default": { + "description": "An unexpected error response", + "schema": { + "$ref": "#/definitions/runtimeError" + } } } } @@ -989,6 +1199,12 @@ "schema": { "$ref": "#/definitions/etcdserverpbAlarmResponse" } + }, + "default": { + "description": "An unexpected error response", + "schema": { + "$ref": "#/definitions/runtimeError" + } } } } @@ -1016,6 +1232,12 @@ "schema": { "$ref": "#/definitions/etcdserverpbDefragmentResponse" } + }, + "default": { + "description": "An unexpected error response", + "schema": { + "$ref": "#/definitions/runtimeError" + } } } } @@ -1043,6 +1265,12 @@ "schema": { "$ref": "#/definitions/etcdserverpbHashKVResponse" } + }, + "default": { + "description": "An unexpected error response", + "schema": { + "$ref": "#/definitions/runtimeError" + } } } } @@ -1079,6 +1307,12 @@ } } } + }, + "default": { + "description": "An unexpected error response", + "schema": { + "$ref": "#/definitions/runtimeError" + } } } } @@ -1106,6 +1340,12 @@ "schema": { "$ref": "#/definitions/etcdserverpbStatusResponse" } + }, + "default": { + "description": "An unexpected error response", + "schema": { + "$ref": "#/definitions/runtimeError" + } } } } @@ -1133,6 +1373,12 @@ "schema": { "$ref": "#/definitions/etcdserverpbMoveLeaderResponse" } + }, + "default": { + "description": "An unexpected error response", + "schema": { + "$ref": "#/definitions/runtimeError" + } } } } @@ -1170,6 +1416,12 @@ } } } + }, + "default": { + "description": "An unexpected error response", + "schema": { + "$ref": "#/definitions/runtimeError" + } } } } @@ -2665,6 +2917,27 @@ } } }, + "runtimeError": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "format": "int32" + }, + "details": { + "type": "array", + "items": { + "$ref": "#/definitions/protobufAny" + } + }, + "error": { + "type": "string" + }, + "message": { + "type": "string" + } + } + }, "runtimeStreamError": { "type": "object", "properties": { diff --git a/Documentation/dev-guide/apispec/swagger/v3election.swagger.json b/Documentation/dev-guide/apispec/swagger/v3election.swagger.json index 048632ef4..ffdc5fdef 100644 --- a/Documentation/dev-guide/apispec/swagger/v3election.swagger.json +++ b/Documentation/dev-guide/apispec/swagger/v3election.swagger.json @@ -21,6 +21,12 @@ "schema": { "$ref": "#/definitions/v3electionpbCampaignResponse" } + }, + "default": { + "description": "An unexpected error response", + "schema": { + "$ref": "#/definitions/runtimeError" + } } }, "parameters": [ @@ -48,6 +54,12 @@ "schema": { "$ref": "#/definitions/v3electionpbLeaderResponse" } + }, + "default": { + "description": "An unexpected error response", + "schema": { + "$ref": "#/definitions/runtimeError" + } } }, "parameters": [ @@ -84,6 +96,12 @@ }, "title": "Stream result of v3electionpbLeaderResponse" } + }, + "default": { + "description": "An unexpected error response", + "schema": { + "$ref": "#/definitions/runtimeError" + } } }, "parameters": [ @@ -111,6 +129,12 @@ "schema": { "$ref": "#/definitions/v3electionpbProclaimResponse" } + }, + "default": { + "description": "An unexpected error response", + "schema": { + "$ref": "#/definitions/runtimeError" + } } }, "parameters": [ @@ -138,6 +162,12 @@ "schema": { "$ref": "#/definitions/v3electionpbResignResponse" } + }, + "default": { + "description": "An unexpected error response", + "schema": { + "$ref": "#/definitions/runtimeError" + } } }, "parameters": [ @@ -229,6 +259,27 @@ } } }, + "runtimeError": { + "type": "object", + "properties": { + "error": { + "type": "string" + }, + "code": { + "type": "integer", + "format": "int32" + }, + "message": { + "type": "string" + }, + "details": { + "type": "array", + "items": { + "$ref": "#/definitions/protobufAny" + } + } + } + }, "runtimeStreamError": { "type": "object", "properties": { diff --git a/Documentation/dev-guide/apispec/swagger/v3lock.swagger.json b/Documentation/dev-guide/apispec/swagger/v3lock.swagger.json index 66bf6f0a6..eb413fd31 100644 --- a/Documentation/dev-guide/apispec/swagger/v3lock.swagger.json +++ b/Documentation/dev-guide/apispec/swagger/v3lock.swagger.json @@ -21,6 +21,12 @@ "schema": { "$ref": "#/definitions/v3lockpbLockResponse" } + }, + "default": { + "description": "An unexpected error response", + "schema": { + "$ref": "#/definitions/runtimeError" + } } }, "parameters": [ @@ -48,6 +54,12 @@ "schema": { "$ref": "#/definitions/v3lockpbUnlockResponse" } + }, + "default": { + "description": "An unexpected error response", + "schema": { + "$ref": "#/definitions/runtimeError" + } } }, "parameters": [ @@ -92,6 +104,39 @@ } } }, + "protobufAny": { + "type": "object", + "properties": { + "type_url": { + "type": "string" + }, + "value": { + "type": "string", + "format": "byte" + } + } + }, + "runtimeError": { + "type": "object", + "properties": { + "error": { + "type": "string" + }, + "code": { + "type": "integer", + "format": "int32" + }, + "message": { + "type": "string" + }, + "details": { + "type": "array", + "items": { + "$ref": "#/definitions/protobufAny" + } + } + } + }, "v3lockpbLockRequest": { "type": "object", "properties": {