strapi-community/strapi-plugin-transformer

Custom Path for content-type not registering middleware in v3.0

jmprice18 opened this issue · 2 comments

If I provide a custom path in a content-type's custom route configuration, this plugin, as of v3.0, does not see that custom path when registering the middleware. It worked fine in v2.2.0.

I believe the issue is that Strapi does not give you the custom path in this call:
const apis = _.get(strapi, ['api'], {}); in the register.js

Example of custom path in custom route:

add new .js in the content-type's route folder, called '01-custom.js'. Add

// 01-custom.js
module.exports = {
  routes: [
    {
      method: "GET",
      path: "/myrestaurants",
      handler: "restaurants.find",
      config: {
        description: "Returns restaurants.",
        policies: [],
      },
    },
  ],
};

Appreciate the work on this plugin and hopefully we can find a way to do this so we can utilize v3 with other plugins like the rest-cache one.

Are you using v3.1 or v3.0 of this plugin? This should work in the latest release.

Appreciate the quick response. I was running v3.0.1 previously and it look like v3.1 resolves this issue!