Sharing Strapi schema with other projects (e.g. front-ends)

For orval we’re currently on 6.10.3 because 6.11 did some stuff that didnt work with our setup
also We had to remove some stuff from the docs as they were throwing errors while generating.

you can give Orval a transformer method to transform the given OpenAPI specs

Object.keys(a.paths).forEach((path) => {
    [
      '/users',
      '/users-permissions/',
      '/auth/',
      '/connect/',
      '/upload/files',
      'Users-Permissions-PermissionsTree',
    ].forEach((key) => {
      if (path.includes(key)) {
        delete a.paths[path];
      }
    });
  });
  console.log(a.paths['/pages/{id}']);
  a.paths['/pages/{id}'].get.parameters[0].schema.type = 'string';
    a.paths['/pages/{id}'].delete.parameters[0].schema.type = 'string';
  a.paths['/pages/{id}'].put.parameters[0].schema.type = 'string';

  Object.keys(a.components.schemas).forEach((path) => {
    [
      'UploadFile',
      'UploadFolder',
      'UsersPermissions',
      'Users-Permissions',
      'requestBodies',
    ].forEach((key) => {
      if (path.includes(key)) {
        delete a.components.schemas[path];
      }
    });
  });
  // remove some keys because it cannot generate types correctly
    Object.keys(a.components.requestBodies).forEach((path) => {
      [
        'UploadFile',
        'UploadFolder',
        'UsersPermissions',
        'Users-Permissions',
        'Users-Permissions-RoleRequest',
      ].forEach((key) => {
        if (path.includes(key)) {
          delete a.components.requestBodies[path];
        }
      });
    });