summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRicardo Wurmus <rekado@elephly.net>2021-02-25 14:04:36 +0100
committerRicardo Wurmus <rekado@elephly.net>2021-02-25 14:04:36 +0100
commit83e1bb5afeb0205b8b8ef07df6be16f3c68e7cf3 (patch)
tree6295aad6f561caf2f4df7f993e1085696b3a626b
parenta21ed8b07f5bad5621a99fef1f2f6fc86cadf895 (diff)
base: aws-operation: Make input argument optional.
-rw-r--r--README.org6
-rw-r--r--aws/base.scm2
2 files changed, 3 insertions, 5 deletions
diff --git a/README.org b/README.org
index 051c313..516774b 100644
--- a/README.org
+++ b/README.org
@@ -1,10 +1,10 @@
Guile AWS is pre-alpha software. At the very least it’s yet another demonstration that Guile’s compiler tower can be used to generate an embedded domain specific language from JSON specifications.
-The DSL Guile AWS produces is unpolished and thus pretty repetitive and ugly. Even in the simplest of cases it is verbose:
+The DSL Guile AWS produces is unpolished and thus pretty repetitive and ugly:
#+begin_src scheme
,use (aws api s3-2006-03-01)
-,pp (ListBuckets #f)
+,pp (ListBuckets)
#+end_src
@@ -19,8 +19,6 @@ Considering all these caveats there are a couple of obvious things to work on:
The S3 API (for example) defines aliases for some operations, such as “PostObjectRestore” for “RestoreObject”. The compiler should process the “alias” field.
** Record possible errors
The S3 API (for example) defines possible error names. While their shape is not specified anywhere we should generate values for these error conditions.
-** Do not require an input
- Some operations don’t require any input, such as =ListBuckets=. For operations like that we should not be forced to specify #F.
** Process output shapes
We generate types for all defined shapes — including output shapes — but we don’t mashall the output SXML into appropriate Scheme values yet.
** Turn errors into Scheme conditions
diff --git a/aws/base.scm b/aws/base.scm
index 55346c7..21a55b9 100644
--- a/aws/base.scm
+++ b/aws/base.scm
@@ -139,7 +139,7 @@
(define* (aws-operation requester #:key name input-type output-type http documentation)
(let ((proc
- (lambda (input)
+ (lambda* (#:optional input)
(unless (eq? (aws-name input) input-type)
(error (format #f "~a: input must be of type ~a: ~a~%"
name input-type input)))