Refactor the openapi schema to be a more generic structure that can be "visited" to get more specific types.