From f47201d72e9144f9070e916d1cafa745509f31c4 Mon Sep 17 00:00:00 2001 From: Ricardo Wurmus Date: Tue, 2 Mar 2021 22:54:10 +0100 Subject: aws/request: Split request-json-string. * aws/request.scm (input-arguments->scm): New procedure. (request-json-string): Use it. --- aws/request.scm | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'aws/request.scm') 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." -- cgit v1.2.3