portkey-cloud / aws-clj-sdk

Clojure bindings for AWS
103 stars 12 forks source link

List of non-understood scalar shape args #15

Open dupuchba opened 6 years ago

dupuchba commented 6 years ago

Here is the complete list of all possible scalar type + their optionnal args. The problem is that I don't yet understand what some of them means (no docs found) and we then can't generate specs on theses one

For e.g : box, sensitive, flattened, streaming,

{"float" #{"min" "max" "type"},
 "boolean" #{"box" "type"},
 "map" #{"min" "key" "max" "value" "sensitive" "type" "flattened" "locationName"},
 "list" #{"member" "min" "max" "deprecated" "sensitive" "type" "flattened"},
 "string" #{"min" "max" "sensitive" "pattern" "type" "enum"},
 "blob" #{"min" "max" "streaming" "sensitive" "type"},
 "long" #{"min" "max" "type"},
 "structure" #{"members"
               "wrapper"
               "exception"
               "error"
               "xmlOrder"
               "deprecated"
               "sensitive"
               "required"
               "type"
               "xmlNamespace"
               "payload"
               "fault"
               "locationName"},
 "timestamp" #{"timestampFormat" "type"},
 "integer" #{"min" "max" "box" "deprecated" "type"},
 "double" #{"min" "max" "box" "type"}}
dupuchba commented 6 years ago

A concrete example of the only 3 map > flattened If someone get it ^^

{"MessageSystemAttributeMap" {"type" "map",
                              "key" {"shape" "MessageSystemAttributeName", "locationName" "Name"},
                              "value" {"shape" "String", "locationName" "Value"},
                              "flattened" true,
                              "locationName" "Attribute"},
 "QueueAttributeMap" {"type" "map",
                      "key" {"shape" "QueueAttributeName", "locationName" "Name"},
                      "value" {"shape" "String", "locationName" "Value"},
                      "flattened" true,
                      "locationName" "Attribute"},
 "MessageBodyAttributeMap" {"type" "map",
                            "key" {"shape" "String", "locationName" "Name"},
                            "value" {"shape" "MessageAttributeValue", "locationName" "Value"},
                            "flattened" true}}
cgrand commented 6 years ago

In the past I used to implement things as they were needed, because understanding all shapes first was overwhelming.

Here is an example (https://docs.aws.amazon.com/AWSSimpleQueueService/latest/APIReference/API_SendMessage.html#API_SendMessage_Examples):

?Action=SendMessage
&MessageBody=This+is+a+test+message
&MessageAttribute.1.Name=test_attribute_name_1
&MessageAttribute.1.Value.StringValue=test_attribute_value_1
&MessageAttribute.1.Value.DataType=String
&MessageAttribute.2.Name=test_attribute_name_2
&MessageAttribute.2.Value.StringValue=test_attribute_value_2
&MessageAttribute.2.Value.DataType=String
&Version=2012-11-05
&Expires=2020-05-05T22%3A52%3A43PST
&AUTHPARAMS

MessageAttribute is a MessageBodyAttributeMap.

dupuchba commented 6 years ago

Ok, that was also a way to not forget this shapes, but I can delete this issue if you want to

cgrand commented 6 years ago

No, no keep it there for now.

Also I think I was making sure that the generator was fully "understanding" an api spec (so as to make it brittle in face of changes).