You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The API doc parser uses fetch() via the fetchResource() method to load API metadata, and fails to apply the query parameter { itemsperpage: 0 } correctly to limit the request to only metadata and no API items.
fetchResource() tries to set the query parameter via a secondary options parameter, however fetch() doesn't support that - params have to be part of the url instead.
// Current code:fetchJsonLd(resourceUrl,Object.assign({itemsPerPage: 0},options))// Fixed code:fetchJsonLd(resourceUrl+"?itemsPerPage=0",options)
ping @soyuka@alanpoulain this one is a real bummer: in every list page of API Platform Admin, it causes a double fetch to the getList endpoint, one without params for introspection (but still returning data), and the other with the correct params.
API Platform version(s) affected: 2.6.8
Description
The API doc parser uses
fetch()
via thefetchResource()
method to load API metadata, and fails to apply the query parameter{ itemsperpage: 0 }
correctly to limit the request to only metadata and no API items.fetchResource()
tries to set the query parameter via a secondaryoptions
parameter, howeverfetch()
doesn't support that - params have to be part of the url instead.How to reproduce
Possible Solution
Replace the Object.assign() call with an URL including the query parameter, possibly by building an URL:
Additional Context
Please excuse that my code examples are in plain JS, not TS, since I'm not familiar enough with typescript.
The text was updated successfully, but these errors were encountered: