@@ -198,7 +198,7 @@ func TestGetRecordSchemaContent(t *testing.T) {
198198 t .Fatalf ("Failed to create schema: %v" , err )
199199 }
200200
201- content , err := schema .GetRecordSchemaContent (context .Background (), WithVersion (tt .version ))
201+ content , err := schema .GetRecordSchemaContent (context .Background (), WithSchemaVersion (tt .version ))
202202 if tt .expectError {
203203 if err == nil {
204204 t .Errorf ("GetRecordSchemaContent() expected error but got none" )
@@ -274,7 +274,7 @@ func TestGetSchema(t *testing.T) {
274274 var opts []SchemaOption
275275
276276 if tt .version != "" {
277- opts = append (opts , WithVersion (tt .version ))
277+ opts = append (opts , WithSchemaVersion (tt .version ))
278278 }
279279
280280 content , err := schema .GetSchema (context .Background (), tt .typ , tt .schemaName , opts ... )
@@ -417,7 +417,7 @@ func TestGetSchemaSkills(t *testing.T) {
417417 t .Fatalf ("Failed to create schema: %v" , err )
418418 }
419419
420- skills , err := schema .GetSchemaSkills (context .Background (), WithVersion (tt .version ))
420+ skills , err := schema .GetSchemaSkills (context .Background (), WithSchemaVersion (tt .version ))
421421 if tt .expectError {
422422 if err == nil {
423423 t .Errorf ("GetSchemaSkills() expected error but got none" )
@@ -489,7 +489,7 @@ func TestGetSchemaDomains(t *testing.T) {
489489 t .Fatalf ("Failed to create schema: %v" , err )
490490 }
491491
492- domains , err := schema .GetSchemaDomains (context .Background (), WithVersion (tt .version ))
492+ domains , err := schema .GetSchemaDomains (context .Background (), WithSchemaVersion (tt .version ))
493493 if tt .expectError {
494494 if err == nil {
495495 t .Errorf ("GetSchemaDomains() expected error but got none" )
@@ -614,18 +614,6 @@ func TestGetAvailableSchemaVersions(t *testing.T) {
614614 {SchemaVersion : "1.0.0" , URL : "http://schema.oasf.outshift.com:8000/1.0.0/api" },
615615 },
616616 }
617- legacyMockResponse := VersionsResponse {
618- Default : VersionInfo {
619- Version : "0.8.0" ,
620- URL : "http://schema.oasf.outshift.com:8000/api/0.8.0" ,
621- },
622- Versions : []VersionInfo {
623- {Version : "0.7.0" , URL : "http://schema.oasf.outshift.com:8000/0.7.0/api" },
624- {Version : "0.8.0" , URL : "http://schema.oasf.outshift.com:8000/0.8.0/api" },
625- {Version : "1.0.0" , URL : "http://schema.oasf.outshift.com:8000/1.0.0/api" },
626- },
627- }
628-
629617 t .Run ("valid versions response" , func (t * testing.T ) {
630618 server := createVersionsMockServer (t , mockResponse )
631619 defer server .Close ()
@@ -642,23 +630,6 @@ func TestGetAvailableSchemaVersions(t *testing.T) {
642630
643631 validateVersionsResult (t , versions )
644632 })
645- t .Run ("legacy versions response" , func (t * testing.T ) {
646- server := createVersionsMockServer (t , legacyMockResponse )
647- defer server .Close ()
648-
649- schema , err := New (server .URL )
650- if err != nil {
651- t .Fatalf ("Failed to create schema: %v" , err )
652- }
653-
654- versions , err := schema .GetAvailableSchemaVersions (context .Background ())
655- if err != nil {
656- t .Errorf ("GetAvailableSchemaVersions() unexpected error: %v" , err )
657- }
658-
659- validateVersionsResult (t , versions )
660- })
661-
662633 t .Run ("empty URL" , func (t * testing.T ) {
663634 _ , err := New ("" )
664635 if err == nil {
@@ -667,12 +638,12 @@ func TestGetAvailableSchemaVersions(t *testing.T) {
667638 })
668639}
669640
670- func TestGetDefaultSchemaVersionLegacyFormat (t * testing.T ) {
641+ func TestGetDefaultSchemaVersion (t * testing.T ) {
671642 server := createVersionsMockServer (t , VersionsResponse {
672- Default : VersionInfo {Version : "0.8.0" },
643+ Default : VersionInfo {SchemaVersion : "0.8.0" },
673644 Versions : []VersionInfo {
674- {Version : "0.7.0" },
675- {Version : "0.8.0" },
645+ {SchemaVersion : "0.7.0" },
646+ {SchemaVersion : "0.8.0" },
676647 },
677648 })
678649 defer server .Close ()
@@ -726,7 +697,7 @@ func TestGetSchemaSkillsNested(t *testing.T) {
726697 t .Fatalf ("Failed to create schema: %v" , err )
727698 }
728699
729- skills , err := schema .GetSchemaSkills (context .Background (), WithVersion (testSchemaVersion ))
700+ skills , err := schema .GetSchemaSkills (context .Background (), WithSchemaVersion (testSchemaVersion ))
730701 if err != nil {
731702 t .Fatalf ("Failed to get skills: %v" , err )
732703 }
@@ -745,7 +716,7 @@ func TestGetSchemaDomainsNested(t *testing.T) {
745716 t .Fatalf ("Failed to create schema: %v" , err )
746717 }
747718
748- domains , err := schema .GetSchemaDomains (context .Background (), WithVersion (testSchemaVersion ))
719+ domains , err := schema .GetSchemaDomains (context .Background (), WithSchemaVersion (testSchemaVersion ))
749720 if err != nil {
750721 t .Fatalf ("Failed to get domains: %v" , err )
751722 }
@@ -765,7 +736,7 @@ func TestGetSchemaModules(t *testing.T) {
765736 }
766737
767738 // Note: modules may not exist in all schema versions
768- _ , err = schema .GetSchemaModules (context .Background (), WithVersion ("0.7.0" ))
739+ _ , err = schema .GetSchemaModules (context .Background (), WithSchemaVersion ("0.7.0" ))
769740 // We don't assert on error since modules might not exist
770741 // This test mainly ensures the function doesn't panic
771742 _ = err
@@ -990,10 +961,10 @@ func TestSchemaCategoriesCachedByVersion(t *testing.T) {
990961 if err := s .Cache (context .Background ()); err != nil {
991962 t .Fatalf ("Cache failed: %v" , err )
992963 }
993- if _ , err := s .GetSchemaModules (context .Background (), WithVersion ("0.8.0" )); err != nil {
964+ if _ , err := s .GetSchemaModules (context .Background (), WithSchemaVersion ("0.8.0" )); err != nil {
994965 t .Fatalf ("GetSchemaModules first cached call failed: %v" , err )
995966 }
996- if _ , err := s .GetSchemaModules (context .Background (), WithVersion ("0.8.0" )); err != nil {
967+ if _ , err := s .GetSchemaModules (context .Background (), WithSchemaVersion ("0.8.0" )); err != nil {
997968 t .Fatalf ("GetSchemaModules second cached call failed: %v" , err )
998969 }
999970
@@ -1054,13 +1025,13 @@ func TestClearCache(t *testing.T) {
10541025 if err := s .Cache (context .Background ()); err != nil {
10551026 t .Fatalf ("Cache failed: %v" , err )
10561027 }
1057- if _ , err := s .GetSchemaSkills (context .Background (), WithVersion ("0.8.0" )); err != nil {
1028+ if _ , err := s .GetSchemaSkills (context .Background (), WithSchemaVersion ("0.8.0" )); err != nil {
10581029 t .Fatalf ("GetSchemaSkills from cache failed: %v" , err )
10591030 }
10601031
10611032 s .ClearCache ()
10621033
1063- if _ , err := s .GetSchemaSkills (context .Background (), WithVersion ("0.8.0" )); err != nil {
1034+ if _ , err := s .GetSchemaSkills (context .Background (), WithSchemaVersion ("0.8.0" )); err != nil {
10641035 t .Fatalf ("GetSchemaSkills after ClearCache failed: %v" , err )
10651036 }
10661037
@@ -1127,7 +1098,7 @@ func TestReloadCache(t *testing.T) {
11271098 if err := s .Cache (context .Background ()); err != nil {
11281099 t .Fatalf ("Cache failed: %v" , err )
11291100 }
1130- first , err := s .GetSchemaSkills (context .Background (), WithVersion ("0.8.0" ))
1101+ first , err := s .GetSchemaSkills (context .Background (), WithSchemaVersion ("0.8.0" ))
11311102 if err != nil {
11321103 t .Fatalf ("GetSchemaSkills first cached read failed: %v" , err )
11331104 }
@@ -1138,7 +1109,7 @@ func TestReloadCache(t *testing.T) {
11381109 if err := s .ReloadCache (context .Background ()); err != nil {
11391110 t .Fatalf ("ReloadCache failed: %v" , err )
11401111 }
1141- second , err := s .GetSchemaSkills (context .Background (), WithVersion ("0.8.0" ))
1112+ second , err := s .GetSchemaSkills (context .Background (), WithSchemaVersion ("0.8.0" ))
11421113 if err != nil {
11431114 t .Fatalf ("GetSchemaSkills second cached read failed: %v" , err )
11441115 }
@@ -1189,7 +1160,7 @@ func TestGetSchemaModulesRejectsUnsupportedVersionBeforeCategoryFetch(t *testing
11891160 t .Fatalf ("Failed to create schema: %v" , err )
11901161 }
11911162
1192- _ , err = s .GetSchemaModules (context .Background (), WithVersion ("1.1.0" ))
1163+ _ , err = s .GetSchemaModules (context .Background (), WithSchemaVersion ("1.1.0" ))
11931164 if err == nil {
11941165 t .Fatalf ("Expected unsupported-version error, got nil" )
11951166 }
0 commit comments