walletrpc: add missing REST body annotation
The missing body annotation caused the library to ignore any parameters sent to this RPC endpoint when using the REST proxy.
This commit is contained in:
3 files changed
+39
-8
No files matched your search
@@ -32,18 +32,15 @@ var _ = runtime.String
|
||||
var _ = utilities.NewDoubleArray
|
||||
var _ = descriptor.ForMessage
|
||||
|
||||
var (
|
||||
filter_WalletKit_ListUnspent_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)}
|
||||
)
|
||||
|
||||
func request_WalletKit_ListUnspent_0(ctx context.Context, marshaler runtime.Marshaler, client WalletKitClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||
var protoReq ListUnspentRequest
|
||||
var metadata runtime.ServerMetadata
|
||||
|
||||
if err := req.ParseForm(); err != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
|
||||
newReader, berr := utilities.IOReaderFactory(req.Body)
|
||||
if berr != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr)
|
||||
}
|
||||
if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_WalletKit_ListUnspent_0); err != nil {
|
||||
if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
|
||||
}
|
||||
|
||||
@@ -56,7 +53,11 @@ func local_request_WalletKit_ListUnspent_0(ctx context.Context, marshaler runtim
|
||||
var protoReq ListUnspentRequest
|
||||
var metadata runtime.ServerMetadata
|
||||
|
||||
if err := runtime.PopulateQueryParameters(&protoReq, req.URL.Query(), filter_WalletKit_ListUnspent_0); err != nil {
|
||||
newReader, berr := utilities.IOReaderFactory(req.Body)
|
||||
if berr != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr)
|
||||
}
|
||||
if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
|
||||
}
|
||||
|
||||
|
||||
@@ -533,6 +533,16 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"parameters": [
|
||||
{
|
||||
"name": "body",
|
||||
"in": "body",
|
||||
"required": true,
|
||||
"schema": {
|
||||
"$ref": "#/definitions/walletrpcListUnspentRequest"
|
||||
}
|
||||
}
|
||||
],
|
||||
"tags": [
|
||||
"WalletKit"
|
||||
]
|
||||
@@ -1212,6 +1222,25 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"walletrpcListUnspentRequest": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"min_confs": {
|
||||
"type": "integer",
|
||||
"format": "int32",
|
||||
"description": "The minimum number of confirmations to be included."
|
||||
},
|
||||
"max_confs": {
|
||||
"type": "integer",
|
||||
"format": "int32",
|
||||
"description": "The maximum number of confirmations to be included."
|
||||
},
|
||||
"account": {
|
||||
"type": "string",
|
||||
"description": "An optional filter to only include outputs belonging to an account."
|
||||
}
|
||||
}
|
||||
},
|
||||
"walletrpcListUnspentResponse": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
|
||||
@@ -5,6 +5,7 @@ http:
|
||||
rules:
|
||||
- selector: walletrpc.WalletKit.ListUnspent
|
||||
post: "/v2/wallet/utxos"
|
||||
body: "*"
|
||||
- selector: walletrpc.WalletKit.LeaseOutput
|
||||
post: "/v2/wallet/utxos/lease"
|
||||
body: "*"
|
||||
|
||||
Reference in new issue
Block a user