-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
API query params presets #12104
Milestone
Comments
etj
added a commit
that referenced
this issue
Mar 29, 2024
12 tasks
etj
added a commit
that referenced
this issue
Mar 29, 2024
12 tasks
giohappy
pushed a commit
that referenced
this issue
Apr 3, 2024
etj
added a commit
that referenced
this issue
Apr 3, 2024
giohappy
pushed a commit
that referenced
this issue
Apr 3, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Short description
We want to define presets to be included in the API queries, that will be expanded server side in multiple query params.
Rationale
After implementing the fixes in #12079, it is now possible to request a specific set of fields, so that DB queries and data retrieval are optimized.
The GeoNode/MapStore client anyway performs some fixed requests, with a limited number of fields, but big enough t make the request URL cumbersome.
Proposed solution
In settings we can add the presets, for instance:
The requesting URL may be something like:
http://server/api/v2/resources?api_preset=q1
There will be a new Filter that modifies the request parameters, replacing the preset request with the related content; so the previous request will be the equivalent of:
http://server/api/v2/resources?exclude[]=*&include[]=pk&include[]=title&include[]=data
Pls note that the query params will be merged, so a request like
http://server/api/v2/resources?api_preset=q1&include[]=perms
will be transformed into
http://server/api/v2/resources?exclude[]=*&include[]=pk&include[]=title&include[]=data&include[]=perms
Caveats
The filter will only expand a preset wherever it is declared. It does not know whether the called entrypoint will really deal with the parameters, so it will be up to the client to make sure the preset will really work with the requested operation.
The text was updated successfully, but these errors were encountered: