@@ -27,9 +27,9 @@ func TestSchema_Defs_Success(t *testing.T) {
2727
2828 // Navigate to the user property which references #/$defs/User
2929 rootSchema := root .MustGetResolvedSchema ()
30- require .True (t , rootSchema .IsLeft ())
30+ require .True (t , rootSchema .IsSchema ())
3131
32- properties := rootSchema .GetLeft ().GetProperties ()
32+ properties := rootSchema .GetSchema ().GetProperties ()
3333 require .NotNil (t , properties )
3434
3535 userProperty , exists := properties .Get ("user" )
@@ -44,10 +44,10 @@ func TestSchema_Defs_Success(t *testing.T) {
4444 // Get the resolved schema
4545 result := userProperty .GetResolvedSchema ()
4646 require .NotNil (t , result )
47- assert .True (t , result .IsLeft ())
47+ assert .True (t , result .IsSchema ())
4848
4949 // Verify it's the User schema
50- resolvedSchema := result .GetLeft ()
50+ resolvedSchema := result .GetSchema ()
5151 assert .Equal (t , []SchemaType {SchemaTypeObject }, resolvedSchema .GetType ())
5252
5353 // Verify it has the expected properties
@@ -56,13 +56,13 @@ func TestSchema_Defs_Success(t *testing.T) {
5656
5757 nameProperty , exists := resolvedProperties .Get ("name" )
5858 require .True (t , exists )
59- assert .True (t , nameProperty .IsLeft ())
60- assert .Equal (t , []SchemaType {SchemaTypeString }, nameProperty .GetLeft ().GetType ())
59+ assert .True (t , nameProperty .IsSchema ())
60+ assert .Equal (t , []SchemaType {SchemaTypeString }, nameProperty .GetSchema ().GetType ())
6161
6262 ageProperty , exists := resolvedProperties .Get ("age" )
6363 require .True (t , exists )
64- assert .True (t , ageProperty .IsLeft ())
65- assert .Equal (t , []SchemaType {SchemaTypeInteger }, ageProperty .GetLeft ().GetType ())
64+ assert .True (t , ageProperty .IsSchema ())
65+ assert .Equal (t , []SchemaType {SchemaTypeInteger }, ageProperty .GetSchema ().GetType ())
6666 })
6767
6868 t .Run ("resolve chained references through $defs" , func (t * testing.T ) {
@@ -78,9 +78,9 @@ func TestSchema_Defs_Success(t *testing.T) {
7878
7979 // Navigate to the user property which references User, which itself references Address
8080 rootSchema := root .MustGetResolvedSchema ()
81- require .True (t , rootSchema .IsLeft ())
81+ require .True (t , rootSchema .IsSchema ())
8282
83- properties := rootSchema .GetLeft ().GetProperties ()
83+ properties := rootSchema .GetSchema ().GetProperties ()
8484 require .NotNil (t , properties )
8585
8686 userProperty , exists := properties .Get ("user" )
@@ -95,10 +95,10 @@ func TestSchema_Defs_Success(t *testing.T) {
9595 // Get the resolved User schema
9696 userResult := userProperty .GetResolvedSchema ()
9797 require .NotNil (t , userResult )
98- assert .True (t , userResult .IsLeft ())
98+ assert .True (t , userResult .IsSchema ())
9999
100100 // Verify the User schema has an address property that references Address
101- userSchema := userResult .GetLeft ()
101+ userSchema := userResult .GetSchema ()
102102 userProperties := userSchema .GetProperties ()
103103 require .NotNil (t , userProperties )
104104
@@ -123,9 +123,9 @@ func TestSchema_Defs_Success(t *testing.T) {
123123
124124 // Navigate to the chainedRef property which references ChainedRef -> ChainedTarget
125125 rootSchema := root .MustGetResolvedSchema ()
126- require .True (t , rootSchema .IsLeft ())
126+ require .True (t , rootSchema .IsSchema ())
127127
128- properties := rootSchema .GetLeft ().GetProperties ()
128+ properties := rootSchema .GetSchema ().GetProperties ()
129129 require .NotNil (t , properties )
130130
131131 chainedProperty , exists := properties .Get ("chainedRef" )
@@ -140,10 +140,10 @@ func TestSchema_Defs_Success(t *testing.T) {
140140 // Get the resolved schema - should be the final ChainedTarget
141141 result := chainedProperty .GetResolvedSchema ()
142142 require .NotNil (t , result )
143- assert .True (t , result .IsLeft ())
143+ assert .True (t , result .IsSchema ())
144144
145145 // Verify it's the ChainedTarget schema
146- resolvedSchema := result .GetLeft ()
146+ resolvedSchema := result .GetSchema ()
147147 assert .Equal (t , []SchemaType {SchemaTypeObject }, resolvedSchema .GetType ())
148148
149149 // Verify it has the expected properties
@@ -152,13 +152,13 @@ func TestSchema_Defs_Success(t *testing.T) {
152152
153153 valueProperty , exists := resolvedProperties .Get ("value" )
154154 require .True (t , exists )
155- assert .True (t , valueProperty .IsLeft ())
156- assert .Equal (t , []SchemaType {SchemaTypeString }, valueProperty .GetLeft ().GetType ())
155+ assert .True (t , valueProperty .IsSchema ())
156+ assert .Equal (t , []SchemaType {SchemaTypeString }, valueProperty .GetSchema ().GetType ())
157157
158158 descProperty , exists := resolvedProperties .Get ("description" )
159159 require .True (t , exists )
160- assert .True (t , descProperty .IsLeft ())
161- assert .Equal (t , []SchemaType {SchemaTypeString }, descProperty .GetLeft ().GetType ())
160+ assert .True (t , descProperty .IsSchema ())
161+ assert .Equal (t , []SchemaType {SchemaTypeString }, descProperty .GetSchema ().GetType ())
162162 })
163163
164164 t .Run ("resolve reference from within nested schema with local $defs" , func (t * testing.T ) {
@@ -174,16 +174,16 @@ func TestSchema_Defs_Success(t *testing.T) {
174174
175175 // Navigate to the NestedSchema which has its own $defs
176176 rootSchema := root .MustGetResolvedSchema ()
177- require .True (t , rootSchema .IsLeft ())
177+ require .True (t , rootSchema .IsSchema ())
178178
179- nestedSchema , ok := rootSchema .GetLeft ().GetDefs ().Get ("NestedSchema" )
179+ nestedSchema , ok := rootSchema .GetSchema ().GetDefs ().Get ("NestedSchema" )
180180 require .True (t , ok )
181181
182182 nestedSchemaResolved := nestedSchema .MustGetResolvedSchema ()
183- require .True (t , nestedSchemaResolved .IsLeft ())
183+ require .True (t , nestedSchemaResolved .IsSchema ())
184184
185185 // Get the localRef property which should reference the local $defs/LocalDef
186- properties := nestedSchemaResolved .GetLeft ().GetProperties ()
186+ properties := nestedSchemaResolved .GetSchema ().GetProperties ()
187187 require .NotNil (t , properties )
188188
189189 localRef , exists := properties .Get ("localRef" )
@@ -199,10 +199,10 @@ func TestSchema_Defs_Success(t *testing.T) {
199199 // Get the resolved localRef schema
200200 localRefResolved := localRef .GetResolvedSchema ()
201201 require .NotNil (t , localRefResolved )
202- require .True (t , localRefResolved .IsLeft ())
202+ require .True (t , localRefResolved .IsSchema ())
203203
204204 // Verify it's the LocalDef schema
205- resolvedSchema := localRefResolved .GetLeft ()
205+ resolvedSchema := localRefResolved .GetSchema ()
206206 assert .Equal (t , []SchemaType {SchemaTypeObject }, resolvedSchema .GetType ())
207207
208208 // Verify it has the expected properties
@@ -211,8 +211,8 @@ func TestSchema_Defs_Success(t *testing.T) {
211211
212212 localValueProperty , exists := resolvedProperties .Get ("localValue" )
213213 require .True (t , exists )
214- assert .True (t , localValueProperty .IsLeft ())
215- assert .Equal (t , []SchemaType {SchemaTypeString }, localValueProperty .GetLeft ().GetType ())
214+ assert .True (t , localValueProperty .IsSchema ())
215+ assert .Equal (t , []SchemaType {SchemaTypeString }, localValueProperty .GetSchema ().GetType ())
216216 })
217217
218218 t .Run ("$defs getter method works correctly" , func (t * testing.T ) {
@@ -222,26 +222,26 @@ func TestSchema_Defs_Success(t *testing.T) {
222222 require .NoError (t , err )
223223
224224 // Get the $defs from the root schema
225- require .True (t , root .IsLeft ())
226- schema := root .GetLeft ()
225+ require .True (t , root .IsSchema ())
226+ schema := root .GetSchema ()
227227 defs := schema .GetDefs ()
228228 require .NotNil (t , defs )
229229
230230 // Verify we have the expected definitions
231231 userDef , exists := defs .Get ("User" )
232232 require .True (t , exists )
233- assert .True (t , userDef .IsLeft ())
234- assert .Equal (t , []SchemaType {SchemaTypeObject }, userDef .GetLeft ().GetType ())
233+ assert .True (t , userDef .IsSchema ())
234+ assert .Equal (t , []SchemaType {SchemaTypeObject }, userDef .GetSchema ().GetType ())
235235
236236 addressDef , exists := defs .Get ("Address" )
237237 require .True (t , exists )
238- assert .True (t , addressDef .IsLeft ())
239- assert .Equal (t , []SchemaType {SchemaTypeObject }, addressDef .GetLeft ().GetType ())
238+ assert .True (t , addressDef .IsSchema ())
239+ assert .Equal (t , []SchemaType {SchemaTypeObject }, addressDef .GetSchema ().GetType ())
240240
241241 nestedDef , exists := defs .Get ("NestedSchema" )
242242 require .True (t , exists )
243- assert .True (t , nestedDef .IsLeft ())
244- assert .Equal (t , []SchemaType {SchemaTypeObject }, nestedDef .GetLeft ().GetType ())
243+ assert .True (t , nestedDef .IsSchema ())
244+ assert .Equal (t , []SchemaType {SchemaTypeObject }, nestedDef .GetSchema ().GetType ())
245245 })
246246}
247247
@@ -261,9 +261,9 @@ func TestSchema_Defs_Error(t *testing.T) {
261261
262262 // Navigate to the nonExistentRef property which references a non-existent definition
263263 rootSchema := root .MustGetResolvedSchema ()
264- require .True (t , rootSchema .IsLeft ())
264+ require .True (t , rootSchema .IsSchema ())
265265
266- properties := rootSchema .GetLeft ().GetProperties ()
266+ properties := rootSchema .GetSchema ().GetProperties ()
267267 require .NotNil (t , properties )
268268
269269 nonExistentProperty , exists := properties .Get ("nonExistentRef" )
@@ -358,9 +358,9 @@ func TestSchema_ExternalDefs_Success(t *testing.T) {
358358
359359 // Navigate to the externalUser property which references external $defs
360360 rootSchema := testSchema .MustGetResolvedSchema ()
361- require .True (t , rootSchema .IsLeft ())
361+ require .True (t , rootSchema .IsSchema ())
362362
363- properties := rootSchema .GetLeft ().GetProperties ()
363+ properties := rootSchema .GetSchema ().GetProperties ()
364364 require .NotNil (t , properties )
365365
366366 externalUserProperty , exists := properties .Get ("externalUser" )
@@ -375,10 +375,10 @@ func TestSchema_ExternalDefs_Success(t *testing.T) {
375375 // Get the resolved schema
376376 result := externalUserProperty .GetResolvedSchema ()
377377 require .NotNil (t , result , "resolved schema should not be nil" )
378- assert .True (t , result .IsLeft (), "resolved schema should be a schema, not a reference" )
378+ assert .True (t , result .IsSchema (), "resolved schema should be a schema, not a reference" )
379379
380380 // Verify the resolved schema has the expected structure
381- resolvedSchema := result .GetLeft ()
381+ resolvedSchema := result .GetSchema ()
382382 assert .Equal (t , []SchemaType {SchemaTypeObject }, resolvedSchema .GetType (), "resolved schema should be object type" )
383383
384384 resolvedProperties := resolvedSchema .GetProperties ()
@@ -387,13 +387,13 @@ func TestSchema_ExternalDefs_Success(t *testing.T) {
387387 // Verify ExternalUser properties
388388 idProperty , exists := resolvedProperties .Get ("id" )
389389 require .True (t , exists , "resolved schema should have id property" )
390- assert .True (t , idProperty .IsLeft (), "id property should be a schema" )
391- assert .Equal (t , []SchemaType {SchemaTypeInteger }, idProperty .GetLeft ().GetType (), "id should be integer type" )
390+ assert .True (t , idProperty .IsSchema (), "id property should be a schema" )
391+ assert .Equal (t , []SchemaType {SchemaTypeInteger }, idProperty .GetSchema ().GetType (), "id should be integer type" )
392392
393393 nameProperty , exists := resolvedProperties .Get ("name" )
394394 require .True (t , exists , "resolved schema should have name property" )
395- assert .True (t , nameProperty .IsLeft (), "name property should be a schema" )
396- assert .Equal (t , []SchemaType {SchemaTypeString }, nameProperty .GetLeft ().GetType (), "name should be string type" )
395+ assert .True (t , nameProperty .IsSchema (), "name property should be a schema" )
396+ assert .Equal (t , []SchemaType {SchemaTypeString }, nameProperty .GetSchema ().GetType (), "name should be string type" )
397397 })
398398
399399 t .Run ("resolve reference to non-existent external $defs" , func (t * testing.T ) {
@@ -422,9 +422,9 @@ func TestSchema_ExternalDefs_Success(t *testing.T) {
422422
423423 // Navigate to the nonExistentUser property which references non-existent external $defs
424424 rootSchema := testSchema .MustGetResolvedSchema ()
425- require .True (t , rootSchema .IsLeft ())
425+ require .True (t , rootSchema .IsSchema ())
426426
427- properties := rootSchema .GetLeft ().GetProperties ()
427+ properties := rootSchema .GetSchema ().GetProperties ()
428428 require .NotNil (t , properties )
429429
430430 nonExistentProperty , exists := properties .Get ("nonExistentUser" )
0 commit comments