def test_parse_spec_with_no_operation_id(openapi_spec_generator):
  """Test parsing a spec where operationId is missing (auto-generation)."""
  openapi_spec = create_minimal_openapi_spec()
  del openapi_spec["paths"]["/test"]["get"]["operationId"]  # Remove operationId

  parsed_operations = openapi_spec_generator.parse(openapi_spec)

  assert len(parsed_operations) == 1
  # Check if operationId is auto generated based on path and method.
  assert parsed_operations[0].name == "test_get"
Test parsing a spec where operationId is missing (auto-generation).
tests/unittests/tools/openapi_tool/openapi_spec_parser/test_openapi_spec_parser.py