strapi-community / strapi-plugin-transformer

A plugin for Strapi Headless CMS that provides the ability to transform the API request or response.
https://market.strapi.io/plugins/strapi-plugin-transformer
MIT License
140 stars 22 forks source link

Is anyway to removeAttributesKey when i use strapi-plugin-menus #89

Closed mingyuyuyu closed 1 year ago

mingyuyuyu commented 1 year ago

to reqeust api for 'http://localhost:1337/api/menus?nested&populate=*' when i use strapi-plugin-menus,it still perseve attribute key,how to resolve it,help me。 image

ComfortablyCoding commented 1 year ago

By default APIs provided by plugins are not transformed. To opt-in to transform the API endpoints for this plugin you use the plugins property in the settings.

e.g.

module.exports = ({ env }) => ({
  // ..
 'transformer': {
    enabled: true,
    config: {
      responseTransforms: {
        removeAttributesKey: true,
        removeDataKey: true,
      },
      plugins: {
        ids: {
          'menus': true,
        }
      }
    }
  },
  // ..
});