def test_parse_external_ref_raises_error(openapi_spec_generator):
  """Check that external references (not starting with #) raise ValueError."""
  openapi_spec = {
      "openapi": "3.1.0",
      "info": {"title": "External Ref API", "version": "1.0.0"},
      "paths": {
          "/external": {
              "get": {
                  "responses": {
                      "200": {
                          "description": "OK",
                          "content": {
                              "application/json": {
                                  "schema": {
                                      "$ref": "external_file.json#/components/schemas/ExternalSchema"
                                  }
                              }
                          },
                      }
                  }
              }
          }
      },
  }
  with pytest.raises(ValueError):
    openapi_spec_generator.parse(openapi_spec)
Check that external references (not starting with #) raise ValueError.
tests/unittests/tools/openapi_tool/openapi_spec_parser/test_openapi_spec_parser.py