Comments (7)
http://jsonapi.org/extending/ has an example about pagination at the bottom, it introduces after, before and limit, as alternate suggestions to skip and limit, which fixes the problem with "jumping items" on page change.
from api2go.
What do you think about passing the query parameters through to the datasource?
from api2go.
Well, they don't have to be parameters of the function. But I would provide utility functions in order to get those, if set.
What do you think?
I would love to have this as api2go feature. Maybe we can find a comfortable solution?
Something like.. SetPageLimit(25).. GetStartItem() string; GetToItem() string;
from api2go.
we could standardize the possible query parameters in my opinion. Put them all into a new struct and pass that struct as a parameter to findAll
from api2go.
I'm not sure standardizing query params makes sense. What do we provide – limit, order (desc / asc), order_col, offset, searchterm, …? These things might be highly application-dependant, so I'd say a map[string]string
is the simplest and most general solution.
from api2go.
Hm yes i think you are right. Let's do it that way then.
from api2go.
yeah that sounds good.
from api2go.
Related Issues (20)
- How to marshal an attribute with variable content? HOT 2
- Model routes should be dasherized, not camelized HOT 5
- Annotations need their own namespace HOT 5
- SetToOneReferenceID called with wrong name when multiple foreign keys to same type HOT 4
- Accessing gin Context from api2go resource handler HOT 1
- Gorilla router not working HOT 1
- Map Merging Preventing Updates HOT 6
- Is it possible to setup a redirect under the FindAll method HOT 1
- jsonapi: Add option to unmarshal from an io.Reader and marshal to an io.Writer
- Errors from SetToOneReferenceID and SetToManyReferenceIDs are ignored HOT 3
- Is this project still being maintained? HOT 6
- Ability to pretty print json output
- MarshalWithUrl merging custom link inside data HOT 2
- Cannot Marshal with top-level Meta HOT 1
- Custom Resource endpoints? HOT 1
- Returning to One Relationships
- Unmarshaling does not correctly parse the "included" part
- Update labstack/echo HOT 2
- Supporting AddResource with a factory function
- relationships links ignoring GetCustomLinks HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from api2go.