summaryrefslogtreecommitdiff
path: root/aws
diff options
context:
space:
mode:
authorRicardo Wurmus <rekado@elephly.net>2021-03-18 14:30:37 +0100
committerRicardo Wurmus <rekado@elephly.net>2021-03-18 14:30:37 +0100
commitc3ca0b399d96dc9881f551aea21f42ecd70acd9a (patch)
tree0985e4810bab4933ff0adc8979cd3fb2885e7a31 /aws
parentb1650734906eb0330de2c5c41a14642ecd6e8a52 (diff)
serialize: Upcase the first letter of any property name.
Diffstat (limited to 'aws')
-rw-r--r--aws/serialize.scm12
1 files changed, 11 insertions, 1 deletions
diff --git a/aws/serialize.scm b/aws/serialize.scm
index e9a1382..f6d12fd 100644
--- a/aws/serialize.scm
+++ b/aws/serialize.scm
@@ -26,6 +26,16 @@
;; See https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Query-Requests.html
(define* (serialize-aws-value thing)
+ ;; XXX: I don't know why this is necessary, but it seems to be
+ ;; required that the locationName begin with an uppercase letter.
+ ;; There is nothing in the specification that would hint at this,
+ ;; but testing against the AWS API have revealed this to be the
+ ;; case. This is at least true for "Value" and "Key" of a "Tag"
+ ;; value, and for "ResourceType" of a "TagSpecification".
+ (define (up string)
+ (let ((s (format #false "~a" string)))
+ (string-set! s 0 (char-upcase (string-ref s 0)))
+ s))
(define inner
(lambda (path thing)
(cond
@@ -63,7 +73,7 @@
(else
(format #false "~{~a~^.~}=~a"
- (reverse (filter identity path))
+ (map up (reverse (filter identity path)))
thing)))))
(define (flatten lst)
(match lst