IATI / js-validator-api

Pure JavaScript IATI validator implementation
GNU Affero General Public License v3.0
2 stars 2 forks source link

Allow users to request just particular elements of the response #542

Open robredpath opened 6 months ago

robredpath commented 6 months ago

As a developer of a system using summary validation data, I want to only transfer summary data so that I can maximise the performance of my application.

In https://github.com/IATI/ckanext-iati/issues/417 we're discussing using the Validator API to provide information for a summary view of publishers. For this, we only need the summary element but as far as I can see I have to return the entire response, which can be lengthy; in that example 40kB across 2000+ lines, but potentially much more, and this really adds up across many responses.

simon-20 commented 3 months ago

@robredpath, can you be more specific about what you may need on the summary element. Is it that you'd want a per-document summary returned for each of a publisher's documents, for a given publisher?

There are API end points for getting summary stats for a given publisher, for all their errors. But it is not per document and, strangely (I've just noticed). (They are not documented on the https://developer.iatistandard.org website because they are not currently public, but we could think about opening them up).

robredpath commented 3 months ago

@simon-20 for this specific use case, it's the summary element that's already provided in the response - the ask here is to be able to request just the summary, rather than the whole response.