Closed mighty-phoenix closed 1 year ago
With the current version the only way to do so is to send the Strapi-Transformer-Ignore header on all routes that you do not want the transforms to run.
Once the next version is released you can utilize the denyList config setting to opt out of all apis that the transformation should not run on.
@ComfortablyCoding don't you think there should be a way to do it the opposite way also, i.e, mention which routes to work on? I have too many APIs being already used at many places. So I can't enable this change on my project, as it would lead to breaking changes, and sending the Strapi-Transformer-Ignore header everywhere Strapi APIs are being called is not a sane option in my case as you would imagine. Thanks!
Agreed, I will think about this a bit more to see optimal solution for both paradigms.
Support for both deny and allow list filtering has been released in v3
cc @mighty-phoenix
@ComfortablyCoding The deny list is not working. This is my configuration:
`transformer': {
enabled: true,
config: {
prefix: '',
responseTransforms: {
removeAttributesKey: true,
removeDataKey: true,
},
denyList: {
'api::service.service': true,
}
}
},
@Montaser-BE Please open a new issue outlining
And any other relevant debug info.
I want to transform the resopnse for a single particular API. How can I enable the plugin on that particular API, and leave the rest of the API responses as they are now? Quick help would be highly appreciated. Thanks! @ComfortablyCoding @cssmagic