REST Documentation: cannot override in order to exclude path

I’ve moved the it inside the src/index.ts:

export default {
  register({ strapi }) {
    strapi
      .plugin("documentation")
      .service("override")
      .excludeFromGeneration(["upload", "Upload - File", "Festival"]);
  },

  bootstrap(/*{ strapi }*/) { },
};

Still the generated documentation includes those tags. What am I missing?