strapi-community/strapi-plugin-transformer

strapi-plugin-publisher still has attributes key

Namstel opened this issue · 3 comments

Hi,

We've been using the strapi-plugin-publisher but we're still seeing the attributes key there. It's not on the denyList either.

Transformer version: v3.1.0
Publisher version: v1.3.3

If you need information, I'd be happy to supply.

Thanks!

@ComfortablyCoding any chance you can look into this? Thanks!

I assume you are referring to the REST endpoints for that plugin. I cannot replicate this issue, the attributes key is removed for me for the following cases below.

allow

module.exports = ({ env }) => ({
  // ..
  transformer: {
    enabled: true,
    config: {
      responseTransforms: {
        removeAttributesKey: true,
        removeDataKey: true,
      },
      // ..
      plugins: {
        ids: {
          // this will allow only publisher to be transformed
          publisher: true,
        },
      },
    },
  },
  // ..
});

deny

module.exports = ({ env }) => ({
  // ..
  transformer: {
    enabled: true,
    config: {
      responseTransforms: {
        removeAttributesKey: true,
        removeDataKey: true,
      },
      // ..
      plugins: {
        mode: 'deny',
        ids: {
         // this will allow all plugins aside from slugify to be transformed
          splugify: true,
        },
      },
    },
  },
  // ..
});

Sorry for the late reply. I completely missed the part where we had to define the plugin in the config, like you did in the first example. That fixed our problem. Thanks!