GithubHelp home page GithubHelp logo

Comments (5)

ComfortablyCoding avatar ComfortablyCoding commented on July 30, 2024

Hello,

Appreciate the interest!

Yes, this should be possible. A request header that indicates that transformation should be skipped sounds fairly easy to implement. At the moment I am considering using Strapi-Transformer-Ignore as the header name. Let me know if you have any recommendations.

Eventually an allow/block list can also be added but that will require more work/thought before implementing.

from strapi-plugin-transformer.

GregorSondermeier avatar GregorSondermeier commented on July 30, 2024

Request header name Strapi-Transformer-Ignore sounds good.

Benefits would be:

  • I could install and use the plugin to have API responses close to the v3 format, which reduces initial refactoring
  • One by one, I can go through my API requests, add that header and do the refactoring
  • Once I'm done, I can uninstall the plugin, or keep it where I need it

Just one more question before settling on this:
Could the prefix configuration property be used for that aswell? Instead of providing a string, it could be a list of strings or a regex that defines which API routes should generally be transformed and which do not. Would provide another level of flexibility.

from strapi-plugin-transformer.

ComfortablyCoding avatar ComfortablyCoding commented on July 30, 2024

The prefix property is meant to define the top level endpoint for the api, regardless of any routes. It needs to stay as is.

In terms of the allow list it would be a seperate property in the settings as it's responsible for a different functionality. Most likely named allowList which would take an array of routes that the plugin should transform.

I will need to research and see how feasible it is to allow regex type routes (/pages/*) and such instead of hardcoding the full route path each time.

from strapi-plugin-transformer.

GregorSondermeier avatar GregorSondermeier commented on July 30, 2024

Thanks for the reply, it makes sense and I agree.

from strapi-plugin-transformer.

ComfortablyCoding avatar ComfortablyCoding commented on July 30, 2024

Closing in favor of #36 and #37 discussions.

from strapi-plugin-transformer.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.