Open milt opened 6 years ago
Fantastic work Milton! @dupuchba do you have time to review it since there’s overlap with your current work?
@cgrand thanks, I love where this project is going! One last review note , I added two additional commits to produce slightly more useable errors (that have the spec keyword, in addition to the shape as a message), but might break downstream projects that rely on the exception map being the root of the ex-info map.
@milt Thanks a lot for your work !!!
I won't be able to review it today but I'll take some time tomorrow !
This PR begins to address #4 by adding support for "json" protocol apis, version 1.0 only. Confirmed working with DynamoDB and DDBStreams.
Other notable changes:
portkey.awsgen/gen-api
dispatches on protocol, then versionportkey.awsgen/gen-operation
is a multimethod, dispatch fn looks at protocol and version if present.portkey.awsgen/gen-api
reports on unsupported versions.portkey.awsgen/generate-files!
now looks for endpoints with both the munged and unmunged name, and does not attempt to generate if they are absent, preventing a runtime NPE.portkey.aws/*endpoint-override*
is a dynamic var that can be used to override the endpoint uri for local testing, etc.portkey.aws/params-toquerystring
no longer puts a?
on URIs if there are no query params.portkey.aws/-json-call
provides request processing for json v1.0 apis with the "X-AMZ-Target" header.portkey.aws/-json-call
finds exceptions that only exist in the body of the response:type
key contains the spec keyword of the exception, and thebody
key contains the exception map (with message) itself.Smells:
portkey.awsgen/gen-operation
for json protocol, and the-json-call
request fn. This should be refactored away as we add more protocols.