Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FEAT] Transformations are not visible in Documentation plugin #100

Open
SalahAdDin opened this issue May 2, 2024 · 1 comment
Open

Comments

@SalahAdDin
Copy link

We are using this plugin to avoid that much nestedness coming from Strapi 4.

It works fine.

When we want to work the API on Frontend we need the documentation plugin so we know what are we getting for any API request.

The problem is, that we don't see any changes done by the transformer in the documentation,
image

Here is our configuration:

  transformer: {
    enabled: true,
    config: {
      responseTransforms: {
        removeAttributesKey: true,
        removeDataKey: true,
      },
      requestTransforms: {
        wrapBodyWithDataKey: true,
      },
    },
  },

Why?

@wow64cpu
Copy link

wow64cpu commented Aug 24, 2024

I have the same issue

The response body changes when interacting with the API, but in the generated Swagger specification the response body does not change. Because of this, it is impossible to directly configure the generation of client code, it remains to finish writing the generator, or to abandon the plugin

I tried changing the "plugins" field in the configuration, but it still doesn't work:

export default () => ({
  transformer: {
    enabled: true,
    config: {
      prefix: '/api/',
      responseTransforms: {
        removeAttributesKey: true,
        removeDataKey: true,
      },
      plugins: {
        ids: {
          documentation: true,
        },
        mode: 'allow'
      }
    }
  },
});

Versions:
"@strapi/plugin-documentation": "^4.25.8"
"strapi-plugin-transformer": "^3.1.2"
"@strapi/strapi": "4.25.8"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants