Fork me on GitHub
#aws
<
2020-07-10
>
thomascothran00:07:28

I'm using aws-api with MediaConvert. After using aws/validate-requests, I get an error:

{ ...
   :path
   [:Settings
    :OutputGroups
    :OutputGroupSettings
    :FileGroupSettings
    :Destination],
   :pred
   (clojure.core/fn
    [%]
    (clojure.core/re-matches (clojure.core/re-pattern "^s3:\\/\\/") %)),
   :val ""
   ...
   }
The :Destination value here will only match the string "s3://". However, this is https://docs.aws.amazon.com/mediaconvert/latest/ug/specify-output-groups.html. I can use MediaConvert (outside aws-api) with the rejected value and it works. Is this likely a bug or might I be overlooking something?

ghadi00:07:08

what :op ?

ghadi00:07:43

do you mind filing a bug for that at cognitect-labs/aws-api ?

ghadi00:07:25

offhand, it looks like the spec is using re-matches instead of re-find

ghadi00:07:16

(most regexes in the APIs descriptors have ^ and $ anchors, but not this one for :CreateJob)

ghadi00:07:50

as a workaround you could maybe redefine the spec to be a little looser @thomas559

ghadi00:07:38

some other regexes from the MediaConvert API descriptors...

ghadi00:07:19

most have the ^ $ anchors

ghadi00:07:33

heh that name "__stringPatternArnAwsUsGovCnKmsAZ26EastWestCentralNorthSouthEastWest1912D12KeyAFAF098AFAF094AFAF094AFAF094AFAF0912"

thomascothran00:07:14

Thanks, @ghadi. I'll file the issue. The spec part is a little opaque to me (not spec as a library, just where they are being defined by aws-api), but I'll take a look and see if I can figure it out.

ghadi00:07:05

The specs are mechanically generated @thomas559

ghadi00:07:38

We’ll have to analyze it some more and maybe modify the generator

ghadi00:07:47

(Which isn’t public)

thomascothran00:07:03

That's the part where I get lost a little, since normally I'd look for a spec (e.g., :a/b ) in the source and override it. Here I'm not sure where to look for the name

ghadi00:07:37

Check (aws/doc client :CreateJob) and see if you can navigate through the specs

thomascothran01:07:08

Thanks, I was able to redefine the spec. In general, having the validation function is enormously useful for something like MediaConvert where the request can be a really big map.