interchange / Amazon-MWS

API binding for Amazon's Marketplace Web Services.
8 stars 8 forks source link

Add more types to TypeMap #21

Open rabbiveesh opened 4 years ago

rabbiveesh commented 4 years ago

Currently, Amazon::MWS::TypeMap only contains basic types, and the rest of the type scheme (which is totally undocumented, but the code is clear enough) resides in the code generated for each endpoint. There are two issues here:

  1. The system is actually very easily extended in terms of adding more basic endpoints (I know this b/c I'm implementing the Recommendations API). It would be easier for people to contribute and help this module cover the whole API if it were more clearly documented (like docs for List *List and *Array)

  2. There are types that aren't really covered by the current scheme, for example ListRecommendations's CategoryQueryList contains lists in some of its key-value pairs. I think if the type system were refactored to be totally in TypeMap, then it could be easily tested and also be made to have recursive types. (while I'm at it, the *Array type is a little terse, and would be better if it took a hashref and dealt with it properly rather than taking an arrayref. Make the calling code harder to use).

I'd be happy to implement this stuff, if that sort of contribution is wanted.

In a side note, what are the thoughts about implementing some sort of introspection for API params? I want to write a simple shell for using MWS, and it would be super cool if I could automatically get the param names from a name of an endpoint. While we're at it, it would also make it easy to generate docs for each endpoint.

racke commented 4 years ago

OK that makes sense to me and yes that sort of contribution is wanted :+1: Please ensure that you rather submit small changes. Otherwise review would be too complicated. You can contact me on questions. W.i.p. previews are appreciated as well.