-
Notifications
You must be signed in to change notification settings - Fork 133
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
Data Endpoint: Support pagination of XML Response #2000
Comments
One option that would meet ETL requirements would be a query parameter to the paginated JSON endpoint which just attached the XML as text in a JSON field. The paginated XML would need to be searchable in the same way as the JSON, so maybe this is a fast workaround. |
As discussed in the product meeting, the requirements for the paginated xml endpoint would include pagination by the last_modified field, which is not included in the xform form instance xml - this would need to be attached as xml metadata. Also, the form_id is not included in the xform instance xml - this also would need to be attached as metadata. Summary: What is needed is: form id |
@DavisRayM what's up on stage-api looks good, as we built more of the pipeline we realized we also need to know the latest server time. Could we wrap the batch of results like:
This will allow us to be much more efficient (and safer) pulling the latest submissions from a form, as now we're never quite sure how recent the timestamps are compared to where the server time actually is. |
I took a quick look - I'm not sure we can use the endpoint as is? There seems to be some issues the lastModified field - here's an example:
The JSON endpoint returns:
I'm not sure where the lastModified date is getting pulled from in the XML batch, but it isn't sorted and it doesn't match the search for date_modified? Is there another query we need to run? Two other issues - empty batches return bad XML:
Note the lack of a closing tag, which breaks the parsing. Also, the JSON endpoint supports a "sort" parameter - in the JSON endpoint, you must specify the sort otherwise your results will not be sorted and so not useful for pagination.
Note that the results here are now correctly sorted and different from the non-sort results. The XML endpoint does not support sort, only an incomplete XML document is returned:
I think the ask here is to fully support the following queries:
and that the "lastModified" attribute in submission-item match _date_modified, assuming that's the appropriate thing to do. |
Suggested Feature / Enhancement
Benefits of implementing the feature/enhancement
Suggested implementation plan(Steps to be taken to implement feature)
The text was updated successfully, but these errors were encountered: