switch case req json media lib