def METHOD_NAME(request, cls, schema, expected):
    # Check that we have a valid schema
    if issubclass(cls, OpenAPI20Parameter):
        template = request.getfixturevalue("empty_open_api_2_schema")
        template["paths"]["/users"] = {"get": {"parameters": [schema], "responses": {"200": {"description": "OK"}}}}
        SWAGGER_20_VALIDATOR.validate(template)
    else:
        template = request.getfixturevalue("empty_open_api_3_schema")
        if issubclass(cls, OpenAPIBody):
            template["paths"]["/users"] = {
                "get": {
                    "requestBody": {"content": {"text/plain": {"schema": schema}}},
                    "responses": {"200": {"description": "OK"}},
                }
            }
        else:
            template["paths"]["/users"] = {"get": {"parameters": [schema], "responses": {"200": {"description": "OK"}}}}
        OPENAPI_30_VALIDATOR.validate(template)
    kwargs = {"media_type": "text/plain"} if issubclass(cls, OpenAPIBody) else {}
    assert cls(schema, **kwargs).example == expected