The Sha'ir of Al-Qadim are an odd sub-type of generally charisma based Wizards, introduced in the Arabian Adventures splatbook for d&d 2e and fleshed out more thoroughly in The Complete Sha'ir's Handbook; they were then republished as a full class in Dragon Magazine #315 for 3e then officialized in Dragon Compendium. They play as a sort of wizard-sorcerer hybrid, or a warlock if you're looking at them with 5e eyes. The 4th edition rules can be found in Heroes of the Elemental Chaos.
Fluff wise, sha'irs are wizards who partner up with a lesser genie, called a "gen", to work their magic. In essence, the gen works a sort of hybrid between a familiar and a stock broker; rather than having conventional spellbooks or memorizing spells themselves, a sha'ir tells their gen what spell they want to cast and then it goes zipping off into the Elemental Planes to try and "find it". For one gen, this may entail acquiring a charged magical token produced on the Elemental Planes that can be tapped into to unleash that specific spell, whilst another gen may soak up enough raw elemental magic to become a temporary "living spellscroll" for its sha'ir. As a result, sha'irs have a much larger spell list than normal wizards, and can even use divine spells.
Ironically, according to the other wiki, sha'ir were pre-Islamic desert wandering poet-oracles in real life. Multiclass Bard, then?
Like most of the content in the Al-Qadim sourcebooks, it's been left to wither on the vine for the past 20 years due to (in)sensitivity towards all things Arab. An update for 5e taking into account the modern geopolitics of the area, including magical artillery blowing up ancient sites and a theologically driven uprising, would be both hilarious and generate phenomenal amounts of butthurt. ISIS should be your next campaign setting.
In 2e, sha'ir competency is counterbalanced by several things.
Firstly, because all of the power comes from the gen, a sha'ir can only have one spell to hand at a time, and then their gen has to go and find another spell.
Secondly, a gen can only hold the power for a spell for three turns, after which it loses the spell whether it was cast or not.
Thirdly, retrieving a spell takes time (1d6+level of the spell); this ranges from rounds ("native" spells) to turns ("universal" spells) to hours (priest spells, foreign wizard spells) -- this is, needless to say, problematic if you're in the middle of a fight.
Fourthly, gens never have more than an 89% chance of retrieving the spell asked for, meaning all that time may be ultimately wasted.
Fifthly, stealing priestly spells via gen may result in divine punishment, which can range from a short-lived bad luck curse to being summoned to an offended god's realm for a personal audience.
Finally, as the sources of a sha'ir's powers, gens are much more high-maintenance than standard familiars; they will direct their masters on personal quests, need time off to sleep and cement bonds with other elementals in order to be at full power, expect praise, and demand a monthly wage to reinforce that they are partners and not slaves. Failure to treat a gen as it expects will cause it to grow increasingly unreliable as it rebels against such cruelty, concluding in it summoning a bigger, nastier, high ranked genie as an arbitrator to force a conclusion, whether that be a sincere restitution or a permanent dissolution of their contract.
In 3e, things are simplified, turning the class into a Charisma-based Wizard. They gain access to a small number of "spells known", which are easier for their gen to retrieve, and retrieving spells essentially replaces the usual wizard mechanic of studying; they don't keep their spells forever, but they don't need to summon a spell directly beforehand either.
Retrieving a spell is based on a DC 20 Diplomacy (Charisma) check, modified favorably by the sha'ir's own level and unfavorably by spell level, if it's a divine spell, metamagic boosts, and if they screwed up a "barter roll" for the same spell earlier.
Depending on how well you rolled your stats, they could be hilariously overpowered, with the ability to cast any spell (like a wizard) at any time (like a sorcerer).
They don't get access to all Cleric spells in this edition either, just the "domain spells" from the Cleric Domains of Air, Chaos, Earth, Fire, Knowledge, Law, Luck, Sun, and Water. All Wizard spells of 6th or lower of the Jin's element are considered to be on the Occultist's spell list.
The Occultist class has a Sha'ir archetype, though it is vastly different from previous iterations and have nothing in common, beyond the Gen familiar and Genie lore.
The Gen, called Jin and using the statistics of small elementals minus a few features, act as occultist implements and are connected to the eight schools of magic, and one of the Air, Earth, Fire, and Water schools. The Occultist gains a gen at 1st, 6th, and 14th levels. Each Jin has a spell of each of its chosen schools per level the Occultist can cast. The Jin still have to be within 30 feet to grant access to the spells.
Further levels grant the Jin the ability to use the Occultist's saving throw and halt HP if higher, to give them the features they lost temporarily and later one of them permanently, and the statistics of a large, huge, and eventually elder elemental.
They also modify Outside contact, granting the Jin the ability to perform these tasks without the need to bribe them, but the Occultist loses the ability to cast that Jin's spells for the duration.
In return for all of this they do not get resonant powers for the elemental schools.
In 4th edition, Sha'irs are presented as an Essentials variant to the Wizard class - yes, they probably could have gotten away with reflavoring the Warlock, but they decided to just make a more Archomental-themed pact for them. 4e Sha'irs are Arcane Controllers keying off of Intelligence and Constitution; they're essentially the same as Wizards, but trade the Arcane Implement Mastery, Ritual Casting and Spellbook features for Gen Servant and Elemental Resistance.
Gen Servant grants them a Familiar for free, and actually makes Sha'irs a little more open to refluffing; whilst the traditional "minor genies" are presented as new familiars (Daolanin, Djinnling, Efreetkin, Maridan), the Sha'ir can take any other familiar instead whilst still functioning.
Elemental Resistance lets a Sha'ir gain Damage Reduction to Acid, Cold, Fire, Lightning and Thunder damage - specifically, they choose which damage type to resist at the end of each extended rest, and they gain Elemental Resistance equal to their Constitution modifier (double that, from level 21 on) when standing adjacent to their familiar in Active mode. The bright side is that the Sha'ir's allies also benefit from this Elemental Resistance if they're standing adjacent to the Sha'ir's familiar.
Aside from those core mechanic tweaks, Sha'irs are literally just wizards. That's it. Even Bladesingers had more complex rules than them. Not that this is necessarily a bad thing.
While 5e doesn't have a specific Sha'ir, the Genie Warlock takes that place. It is quite different from the other iterations, with a free vessel that acts as a house, bonus damage, resistance similar to the 4e Sha'ir, the lack of a Gen familiar, and not retrieving spells. The only thing that makes it even remotely similar is the Genie connection and the ability to cast any 6th or lower level spell with a casting time of one action once per 1d4 days.
|Dungeons & Dragons 4th Edition Classes|
|Player's Handbook 1:||Cleric - Fighter - Paladin - Ranger - Rogue - Warlock - Warlord - Wizard|
|Player's Handbook 2:||Avenger - Barbarian - Bard - Druid - Invoker - Shaman - Sorcerer - Warden|
|Player's Handbook 3:||Ardent - Battlemind - Monk - Psion - Runepriest - Seeker|
|Heroes of X:||Blackguard* - Binder* - Cavalier* - Elementalist* - Hexblade* - Hunter*|
Mage* - Knight* - Protector* - Scout* - Sentinel*
Skald* - Slayer* - Sha'ir* - Thief* - Vampire* - Warpriest* - Witch*
|Settings Book:||Artificer - Bladesinger* - Swordmage|
|Others:||Paragon Path - Epic Destiny|
*·: Non-AEDU variant classes
|Dungeons & Dragons 5th Edition Classes|
|Barbarian - Bard - Cleric - Druid - Fighter - Monk |
Paladin - Ranger - Rogue - Sorcerer - Warlock - Wizard
|Tasha's Cauldron of Everything:||Artificer - Expert - Spellcaster - Warrior|
|Van Richten's Guide to Ravenloft:||Apprentice - Disciple - Sneak - Squire|
|The Classes of Pathfinder 1st Edition|
|Core Classes:||Barbarian - Bard - Cleric - Druid - Fighter - Monk |
Paladin - Ranger - Rogue - Sorcerer - Wizard
|Alchemist - Antipaladin - Cavalier |
Inquisitor - Oracle - Summoner - Witch
|Arcanist - Bloodrager - Brawler - Hunter - Investigator |
Shaman - Skald - Slayer - Swashbuckler - Warpriest
|Kineticist - Medium - Mesmerist |
Occultist - Psychic - Spiritualist
|Ultimate X:||Gunslinger - Magus - Ninja - Samurai - Shifter - Vigilante|