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
139 stars 21 forks source link

[FR] add transformation support for plugin APIs #77

Closed maurice-ellis closed 1 year ago

maurice-ellis commented 1 year ago

Hi, love this plugin, but it doesn't transform content types from plugins. Is there a reason why?

ComfortablyCoding commented 1 year ago

Thanks :)

Plugins are not guarunteed to adhere to the core api format and certain plugins (mostly the core ones e.g. content manager, content builder etc) should not be transformed as they can potentially break the admin. Due to these reasons at the moment by default all plugins are excluded from transformation. I do plan on adding a configuration option for allowing specific plugins, but no ETA.

vharadkou commented 1 year ago

Can you please work on it? Version 2.2.0 supported custom plugin transformation. For example, I am using strapi-plugin-slugify and on version 3.0.0 "attributes" property is not removed. But once again, it's working fine on version 2.2.0 of strapi-plugin-transformer.

Any comment on why you removed previously worked functionality??

ComfortablyCoding commented 1 year ago

It was removed for the reasons above and at the time I had not yet though about how I wanted it to work with the new format. I will see if I can release a rudimentary support version over the weekend

vharadkou commented 1 year ago

Ok, please leave at least this possibility with the deprecated flag or smth else (like work with old mode). It was not a good idea to remove it altogether. Since some devs are already relying on these rules. Please keep the old mode under the deprecation flag and only remove it when the new format supports it.

Many thanks for considering this request. Please let us know of any updates in this thread.

ComfortablyCoding commented 1 year ago

Sorry, been sick for the last week or so. This should be fixed by #82 , still needs a bit of testing but plan to merge over the weekend. Feel free to test it out.

ComfortablyCoding commented 1 year ago

This should now be possible in v3.1.0 via #82

vharadkou commented 1 year ago

@ComfortablyCoding, thank you for the update. It's working!