@@ -521,7 +521,6 @@ func TestSchemaProxy_ConcurrentCacheAccess(t *testing.T) {
521
521
}
522
522
523
523
func TestSchemaProxy_ParentProxyPreservedForCachedSchemas (t * testing.T ) {
524
- // Create schema that will be cached
525
524
const ymlComponents = `components:
526
525
schemas:
527
526
TestSchema:
@@ -535,7 +534,6 @@ func TestSchemaProxy_ParentProxyPreservedForCachedSchemas(t *testing.T) {
535
534
assert .NoError (t , err )
536
535
idx := index .NewSpecIndexWithConfig (& idxNode , index .CreateOpenAPIIndexConfig ())
537
536
538
- // Create first proxy and get schema (this will cache it)
539
537
const ymlSchema = `$ref: '#/components/schemas/TestSchema'`
540
538
var node1 yaml.Node
541
539
yaml .Unmarshal ([]byte (ymlSchema ), & node1 )
@@ -547,12 +545,10 @@ func TestSchemaProxy_ParentProxyPreservedForCachedSchemas(t *testing.T) {
547
545
Value : lowProxy1 , ValueNode : node1 .Content [0 ],
548
546
})
549
547
550
- // Get schema from first proxy (this should cache it)
551
548
schema1 := proxy1 .Schema ()
552
549
assert .NotNil (t , schema1 )
553
550
assert .Equal (t , proxy1 , schema1 .ParentProxy , "First schema should have correct ParentProxy" )
554
551
555
- // Create second proxy for same schema reference
556
552
var node2 yaml.Node
557
553
yaml .Unmarshal ([]byte (ymlSchema ), & node2 )
558
554
@@ -563,12 +559,8 @@ func TestSchemaProxy_ParentProxyPreservedForCachedSchemas(t *testing.T) {
563
559
Value : lowProxy2 , ValueNode : node2 .Content [0 ],
564
560
})
565
561
566
- // Get schema from second proxy (this should return cached schema)
567
562
schema2 := proxy2 .Schema ()
568
563
assert .NotNil (t , schema2 )
569
-
570
- // CRITICAL TEST: Each proxy should have its own parent relationship
571
- // Currently fails due to the race condition fix
572
564
assert .Equal (t , proxy2 , schema2 .ParentProxy , "Second schema should have its own ParentProxy, not the first proxy's" )
573
565
assert .NotEqual (t , schema1 .ParentProxy , schema2 .ParentProxy , "Different proxies should have different parent relationships" )
574
566
}
0 commit comments