PrimeIntellect/SWE-rebench-V2 huggingface dataset:
Repository: getkin/kin-openapi (go)

Issue:
bug: validation of a slice of non-empty interface against an array schema should pass
### Context

An array schema validates only against a slice of empty interface: `[]interface{}{...}`. If a slice of non-empty interface (e.g. `[]string{...}`) is attempted to validate against that schema, this error occurs: `unhandled value of type []string`

### Reproduce

```go
package main

import (
	"fmt"

	"github.com/getkin/kin-openapi/openapi3"
)

func main() {
	schema := &openapi3.Schema{
		Type:        "array",
		UniqueItems: true,
		Items:       openapi3.NewStringSchema().NewRef(),
	}
	data := []string{"foo", "bar"}
	err := schema.VisitJSON(data)
	fmt.Println(err)
}
```

### Expected

In this case, a nil error should be printed because `VisitJSON` would recognize that `data` is a slice.

There is a bug in `VisitJSON` where the `[]interface{}` case does not cover all slices: https://github.com/getkin/kin-openapi/blob/9f99fee5a643dd7522772022cda4eee8b7f3f614/openapi3/schema.go#L1108-L1109

Pull request:
openapi3: fix validation of non-empty interface slice value against array schema
Resolves #751 

In `VisitJSON` after the `switch` block, it checks `value`'s Kind. If it is a Slice, it transforms the `value` into a slice of empty interfaces and passes it to `visitJSONArray`

`TestSchemas` did not catch this because the data (`AllValid` and `AllInvalid`) are coerced to empty interface types.

Patch:
diff --git a/openapi3/schema.go b/openapi3/schema.go
index 0d1d183..415c281 100644
--- a/openapi3/schema.go
+++ b/openapi3/schema.go
@@ -1120,6 +1120,17 @@ func (schema *Schema) visitJSON(settings *schemaValidationSettings, value interf
 			return schema.visitJSONObject(settings, values)
 		}
 	}
+
+	// Catch slice of non-empty interface type
+	if reflect.TypeOf(value).Kind() == reflect.Slice {
+		valueR := reflect.ValueOf(value)
+		newValue := make([]interface{}, valueR.Len())
+		for i := 0; i < valueR.Len(); i++ {
+			newValue[i] = valueR.Index(i).Interface()
+		}
+		return schema.visitJSONArray(settings, newValue)
+	}
+
 	return &SchemaError{
 		Value:                 value,
 		Schema:                schema,


Test patch:
diff --git a/openapi3/schema_test.go b/openapi3/schema_test.go
index 2bd9848..2666979 100644
--- a/openapi3/schema_test.go
+++ b/openapi3/schema_test.go
@@ -1354,3 +1354,15 @@ enum:
 	err = schema.VisitJSON(map[string]interface{}{"d": "e"})
 	require.Error(t, err)
 }
+
+func TestIssue751(t *testing.T) {
+	schema := &Schema{
+		Type:        "array",
+		UniqueItems: true,
+		Items:       NewStringSchema().NewRef(),
+	}
+	validData := []string{"foo", "bar"}
+	invalidData := []string{"foo", "foo"}
+	require.NoError(t, schema.VisitJSON(validData))
+	require.ErrorContains(t, schema.VisitJSON(invalidData), "duplicate items found")
+}
Repository: slawlor/ractor (rust)

Issue:
ActorRef::get_children() clears children record from supervision tree
**Describe the bug**

I'm not sure if this is intentional, but it's definitely a footgun. If I call `some_actor.get_children()` twice, then the second time returns an empty Vec. The children actors are still running and points to the original parent (half unlinked).

**To Reproduce**
Steps to reproduce the behavior:
1. Create an actor tree
2. On root actor, call `root.get_children()`
3. `assert_eq!(first_children_len, second_children_len)`
4. See error

**Expected behavior**

There should be a  non-destructive way to retrieve the list of children actors.

**Additional context**

https://github.com/slawlor/ractor/blob/main/ractor/src/actor/supervision.rs#L140

Pull request:
fix: get_children should not break supervision tree integrity
This fixes #310 

Please suggest where and what tests I can add.

Patch:
diff --git a/ractor/src/actor/supervision.rs b/ractor/src/actor/supervision.rs
index 06773dd..8b6ef63 100644
--- a/ractor/src/actor/supervision.rs
+++ b/ractor/src/actor/supervision.rs
@@ -57,7 +57,11 @@ impl SupervisionTree {
     /// from the supervision tree since the supervisor is shutting down
     /// and can't deal with superivison events anyways
     pub(crate) fn terminate_all_children(&self) {
-        let cells = self.get_children();
+        let mut guard = self.children.lock().unwrap();
+        let cells = guard.values().cloned().collect::<Vec<_>>();
+        guard.clear();
+        // drop the guard to not deadlock on double-link
+        drop(guard);
         for cell in cells {
             cell.terminate();
             cell.clear_supervisor();
@@ -134,13 +138,10 @@ impl SupervisionTree {
         }
     }
 
+    /// Return all linked children
     pub(crate) fn get_children(&self) -> Vec<ActorCell> {
-        let mut guard = self.children.lock().unwrap();
-        let cells = guard.iter().map(|(_, a)| a.clone()).collect::<Vec<_>>();
-        guard.clear();
-        // drop the guard to not deadlock on double-link
-        drop(guard);
-        cells
+        let guard = self.children.lock().unwrap();
+        guard.values().cloned().collect()
     }
 
     /// Send a notification to the supervisor.


Test patch:
diff --git a/ractor/src/actor/tests/supervisor.rs b/ractor/src/actor/tests/supervisor.rs
index ff5f45f..ad1e2e6 100644
--- a/ractor/src/actor/tests/supervisor.rs
+++ b/ractor/src/actor/tests/supervisor.rs
@@ -1557,6 +1557,9 @@ async fn draining_children_will_shutdown_parent_too() {
     // notify the parent (supervisor) and take that down too
     supervisor_ref.drain_children();
 
+    // children were not unlinked by draining them (fixed from #310)
+    assert!(!supervisor_ref.get_children().is_empty());
+
     // Wait for exit
     s_handle.await.unwrap();
     c_handle.await.unwrap();