jsonapi-mapper
jsonapi-mapper copied to clipboard
Support for page and pageSize in pagination
The JSONAPI Spec is agnostic about pagination strategies: http://jsonapi.org/format/#fetching-pagination
The default bookshelf plugin supports two strategies: https://github.com/tgriesser/bookshelf/wiki/Plugin:-Pagination
The default uses page and pageSize, although limit and offset can also be used.
It would be great if this library could support both.
Whilst I'm here, I must say that whilst I understand why TypeScript is a good choice for this sort of code, it does create a huge barrier to contributing. I'm testing this library out as a way to get from bookshelf to JSONAPI for a couple of APIs I'm building and I'd love to get stuck in and help but I don't know TypeScript 😞
TypeScript won't normally go against you. Try first thinking your ideas in pseudocode, then ES6 and then the types you're handling. There's many things reasons typescript won't get in your way:
- It doesn't add custom mandatory syntax. Most ES6 will be 95% compatible.
- Compilation errors are not blocking, they will still generate (as best as it can) the corresponding Javascript. You will still be able to error-compile and run tests that do pass, for example.
- We are here! Open a PR and we will be actively looking at the good ideas or the mistakes you make in the way and provide feedback to fix or help you. If we're logged in, you can also find help at our gitter channel
- If all that fails, the typescript documentation, the typescript book, and the typescript spec are great resources to find answers on your own. The typescript gitter channel too.
@ErisDS certainly open to supporting this!
With regards to Typescript: as @ShadowManu alluded to, the transition isn't nearly as daunting as one may think. I'm the original creator of this library and when I had wrote it, it wasn't typescript. After @ShadowManu did the original rewrite in TS, I jumped in and contributed with very few issues caused by TS. In fact, it was fairly simple. I'd suggest you give it a shot and as @ShadowManu mentioned, we're here to help!
I appreciate the positive response to what was a moan, however I'm pretty strapped for time 😁 Could you perhaps add a brief getting started guide to the README or contributing.md that covers how to setup, build the repo, and run the tests? A couple of bullet points & commands would be a real help to get over the wall.
Sounds reasonable. I have a little free time for this. EDIT: the contributing page is now added ;)