summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRicardo Wurmus <rekado@elephly.net>2021-03-02 22:54:10 +0100
committerRicardo Wurmus <rekado@elephly.net>2021-03-02 22:54:10 +0100
commitf47201d72e9144f9070e916d1cafa745509f31c4 (patch)
tree123662b355e295a9b8a39150bf56f2afc2d711c1
parent4df3337b56e4cd62b64a4a5c5557b9dffe1cc006 (diff)
aws/request: Split request-json-string.
* aws/request.scm (input-arguments->scm): New procedure. (request-json-string): Use it.
-rw-r--r--aws/request.scm10
1 files changed, 7 insertions, 3 deletions
diff --git a/aws/request.scm b/aws/request.scm
index 4090f00..9b36d5d 100644
--- a/aws/request.scm
+++ b/aws/request.scm
@@ -157,12 +157,16 @@ which can easily be converted to JSON."
(list->vector (map aws-value->scm l)))
(x x)))))
+(define (input-arguments->scm input)
+ "Return the arguments of the INPUT value as an alist. Drop the
+operation name."
+ (match (aws-value->scm input)
+ (((op-name . params)) params)))
+
(define (request-json-string input)
"Return a request JSON block. Drop the operation name as it is
already mentioned in the request headers."
- (match (aws-value->scm input)
- (((op-name . params))
- (scm->json-string params))))
+ (scm->json-string (input-arguments->scm input)))
(define* (make-operation->request api-metadata)
"Return a procedure that accepts an operation and returns an HTTP request."