Defined the depth serializer based on query parameter in the url