portkey-cloud / aws-clj-sdk

Clojure bindings for AWS
103 stars 12 forks source link

Serialize/deserialize fns instead if conformers #27

Open viesti opened 6 years ago

viesti commented 6 years ago

To keep specs cleaner and to serve documentation better. Partial work in a wip branch currently.

Making note of Slack discussion:

So in gen-api I make provision for some vars (prefixed by ser- deser- req- and resp- followed by a spec name), they are expectd to be populated by functions doing transformations.

the core fn would be rest-xml-call, it could do the generic xml lifting

req- resp- could work from the request/response maps with parsed bodies

and ser- deser- do the local transformations

example of local transformation: turning a <list> tag into an actual list

req ser resp deser are not specs but functions, and they are not generated at the moment. Vars are created beforehand to be declared (because cycles may happen).

1/ call conform or valid 2/ call req<-create-function-request -- it indirectly calls some ser-stuff to performs coercion and small fixes 3/ serialize the body of the request in the *-call fn