Set param as 'required' iff required, else set as 'optional'