Sanitizes pagination and sorting options in a reusable and serializable way.