@@ -990,6 +990,315 @@ exports[`resolve OpenAPI 3.1.0 strategy given OpenAPI 3.1.0 definition via URL s
990
990
}
991
991
` ;
992
992
993
+ exports [` resolve OpenAPI 3.1.0 strategy given OpenAPI 3.1.0 definition via spec option and baseDoc option is provided and baseDoc option is a relative reference should resolve the definition with the resolved baseDoc 1` ] = `
994
+ {
995
+ " errors" : [],
996
+ " spec" : {
997
+ " $$normalized" : true ,
998
+ " components" : {
999
+ " schemas" : {
1000
+ " Error" : {
1001
+ " properties" : {
1002
+ " code" : {
1003
+ " format" : " int32" ,
1004
+ " type" : " integer" ,
1005
+ },
1006
+ " message" : {
1007
+ " type" : " string" ,
1008
+ },
1009
+ },
1010
+ " required" : [
1011
+ " code" ,
1012
+ " message" ,
1013
+ ],
1014
+ " type" : " object" ,
1015
+ },
1016
+ " Pet" : {
1017
+ " properties" : {
1018
+ " id" : {
1019
+ " format" : " int64" ,
1020
+ " type" : " integer" ,
1021
+ },
1022
+ " name" : {
1023
+ " type" : " string" ,
1024
+ },
1025
+ " tag" : {
1026
+ " type" : " string" ,
1027
+ },
1028
+ },
1029
+ " required" : [
1030
+ " id" ,
1031
+ " name" ,
1032
+ ],
1033
+ " type" : " object" ,
1034
+ },
1035
+ " Pets" : {
1036
+ " items" : {
1037
+ " $$ref" : " https://smartbear.com/petstore.json#/components/schemas/Pet" ,
1038
+ " properties" : {
1039
+ " id" : {
1040
+ " format" : " int64" ,
1041
+ " type" : " integer" ,
1042
+ },
1043
+ " name" : {
1044
+ " type" : " string" ,
1045
+ },
1046
+ " tag" : {
1047
+ " type" : " string" ,
1048
+ },
1049
+ },
1050
+ " required" : [
1051
+ " id" ,
1052
+ " name" ,
1053
+ ],
1054
+ " type" : " object" ,
1055
+ },
1056
+ " maxItems" : 100 ,
1057
+ " type" : " array" ,
1058
+ },
1059
+ },
1060
+ },
1061
+ " info" : {
1062
+ " license" : {
1063
+ " name" : " MIT" ,
1064
+ },
1065
+ " title" : " Swagger Petstore" ,
1066
+ " version" : " 1.0.0" ,
1067
+ },
1068
+ " openapi" : " 3.1.0" ,
1069
+ " paths" : {
1070
+ " /pets" : {
1071
+ " get" : {
1072
+ " operationId" : " listPets" ,
1073
+ " parameters" : [
1074
+ {
1075
+ " description" : " How many items to return at one time (max 100)" ,
1076
+ " in" : " query" ,
1077
+ " name" : " limit" ,
1078
+ " required" : false ,
1079
+ " schema" : {
1080
+ " format" : " int32" ,
1081
+ " maximum" : 100 ,
1082
+ " type" : " integer" ,
1083
+ },
1084
+ },
1085
+ ],
1086
+ " responses" : {
1087
+ " 200" : {
1088
+ " content" : {
1089
+ " application/json" : {
1090
+ " schema" : {
1091
+ " $$ref" : " https://smartbear.com/petstore.json#/components/schemas/Pets" ,
1092
+ " items" : {
1093
+ " $$ref" : " https://smartbear.com/petstore.json#/components/schemas/Pet" ,
1094
+ " properties" : {
1095
+ " id" : {
1096
+ " format" : " int64" ,
1097
+ " type" : " integer" ,
1098
+ },
1099
+ " name" : {
1100
+ " type" : " string" ,
1101
+ },
1102
+ " tag" : {
1103
+ " type" : " string" ,
1104
+ },
1105
+ },
1106
+ " required" : [
1107
+ " id" ,
1108
+ " name" ,
1109
+ ],
1110
+ " type" : " object" ,
1111
+ },
1112
+ " maxItems" : 100 ,
1113
+ " type" : " array" ,
1114
+ },
1115
+ },
1116
+ },
1117
+ " description" : " A paged array of pets" ,
1118
+ " headers" : {
1119
+ " x-next" : {
1120
+ " description" : " A link to the next page of responses" ,
1121
+ " schema" : {
1122
+ " type" : " string" ,
1123
+ },
1124
+ },
1125
+ },
1126
+ },
1127
+ " default" : {
1128
+ " content" : {
1129
+ " application/json" : {
1130
+ " schema" : {
1131
+ " $$ref" : " https://smartbear.com/petstore.json#/components/schemas/Error" ,
1132
+ " properties" : {
1133
+ " code" : {
1134
+ " format" : " int32" ,
1135
+ " type" : " integer" ,
1136
+ },
1137
+ " message" : {
1138
+ " type" : " string" ,
1139
+ },
1140
+ },
1141
+ " required" : [
1142
+ " code" ,
1143
+ " message" ,
1144
+ ],
1145
+ " type" : " object" ,
1146
+ },
1147
+ },
1148
+ },
1149
+ " description" : " unexpected error" ,
1150
+ },
1151
+ },
1152
+ " servers" : [
1153
+ {
1154
+ " url" : " http://petstore.swagger.io/v1" ,
1155
+ },
1156
+ ],
1157
+ " summary" : " List all pets" ,
1158
+ " tags" : [
1159
+ " pets" ,
1160
+ ],
1161
+ },
1162
+ " post" : {
1163
+ " operationId" : " createPets" ,
1164
+ " responses" : {
1165
+ " 201" : {
1166
+ " description" : " Null response" ,
1167
+ },
1168
+ " default" : {
1169
+ " content" : {
1170
+ " application/json" : {
1171
+ " schema" : {
1172
+ " $$ref" : " https://smartbear.com/petstore.json#/components/schemas/Error" ,
1173
+ " properties" : {
1174
+ " code" : {
1175
+ " format" : " int32" ,
1176
+ " type" : " integer" ,
1177
+ },
1178
+ " message" : {
1179
+ " type" : " string" ,
1180
+ },
1181
+ },
1182
+ " required" : [
1183
+ " code" ,
1184
+ " message" ,
1185
+ ],
1186
+ " type" : " object" ,
1187
+ },
1188
+ },
1189
+ },
1190
+ " description" : " unexpected error" ,
1191
+ },
1192
+ },
1193
+ " servers" : [
1194
+ {
1195
+ " url" : " http://petstore.swagger.io/v1" ,
1196
+ },
1197
+ ],
1198
+ " summary" : " Create a pet" ,
1199
+ " tags" : [
1200
+ " pets" ,
1201
+ ],
1202
+ },
1203
+ " servers" : [
1204
+ {
1205
+ " url" : " http://petstore.swagger.io/v1" ,
1206
+ },
1207
+ ],
1208
+ },
1209
+ " /pets/{petId}" : {
1210
+ " get" : {
1211
+ " operationId" : " showPetById" ,
1212
+ " parameters" : [
1213
+ {
1214
+ " description" : " The id of the pet to retrieve" ,
1215
+ " in" : " path" ,
1216
+ " name" : " petId" ,
1217
+ " required" : true ,
1218
+ " schema" : {
1219
+ " type" : " string" ,
1220
+ },
1221
+ },
1222
+ ],
1223
+ " responses" : {
1224
+ " 200" : {
1225
+ " content" : {
1226
+ " application/json" : {
1227
+ " schema" : {
1228
+ " $$ref" : " https://smartbear.com/petstore.json#/components/schemas/Pet" ,
1229
+ " properties" : {
1230
+ " id" : {
1231
+ " format" : " int64" ,
1232
+ " type" : " integer" ,
1233
+ },
1234
+ " name" : {
1235
+ " type" : " string" ,
1236
+ },
1237
+ " tag" : {
1238
+ " type" : " string" ,
1239
+ },
1240
+ },
1241
+ " required" : [
1242
+ " id" ,
1243
+ " name" ,
1244
+ ],
1245
+ " type" : " object" ,
1246
+ },
1247
+ },
1248
+ },
1249
+ " description" : " Expected response to a valid request" ,
1250
+ },
1251
+ " default" : {
1252
+ " content" : {
1253
+ " application/json" : {
1254
+ " schema" : {
1255
+ " $$ref" : " https://smartbear.com/petstore.json#/components/schemas/Error" ,
1256
+ " properties" : {
1257
+ " code" : {
1258
+ " format" : " int32" ,
1259
+ " type" : " integer" ,
1260
+ },
1261
+ " message" : {
1262
+ " type" : " string" ,
1263
+ },
1264
+ },
1265
+ " required" : [
1266
+ " code" ,
1267
+ " message" ,
1268
+ ],
1269
+ " type" : " object" ,
1270
+ },
1271
+ },
1272
+ },
1273
+ " description" : " unexpected error" ,
1274
+ },
1275
+ },
1276
+ " servers" : [
1277
+ {
1278
+ " url" : " http://petstore.swagger.io/v1" ,
1279
+ },
1280
+ ],
1281
+ " summary" : " Info for a specific pet" ,
1282
+ " tags" : [
1283
+ " pets" ,
1284
+ ],
1285
+ },
1286
+ " servers" : [
1287
+ {
1288
+ " url" : " http://petstore.swagger.io/v1" ,
1289
+ },
1290
+ ],
1291
+ },
1292
+ },
1293
+ " servers" : [
1294
+ {
1295
+ " url" : " http://petstore.swagger.io/v1" ,
1296
+ },
1297
+ ],
1298
+ },
1299
+ }
1300
+ ` ;
1301
+
993
1302
exports [` resolve OpenAPI 3.1.0 strategy given OpenAPI 3.1.0 definition via spec option and baseDoc option is provided should resolve 1` ] = `
994
1303
{
995
1304
" errors" : [],
@@ -1410,7 +1719,7 @@ exports[`resolve OpenAPI 3.1.0 strategy given OpenAPI 3.1.0 definition via spec
1410
1719
}
1411
1720
` ;
1412
1721
1413
- exports [` resolve OpenAPI 3.1.0 strategy given OpenAPI 3.1.0 definition via spec option and neither baseDoc nor url option is provided should resolve 1` ] = `
1722
+ exports [` resolve OpenAPI 3.1.0 strategy given OpenAPI 3.1.0 definition via spec option and neither baseDoc nor url option is provided should resolve using implicit baseURI=https://smartbear.com/ 1` ] = `
1414
1723
{
1415
1724
" errors" : [],
1416
1725
" spec" : {
@@ -1454,6 +1763,7 @@ exports[`resolve OpenAPI 3.1.0 strategy given OpenAPI 3.1.0 definition via spec
1454
1763
},
1455
1764
" Pets" : {
1456
1765
" items" : {
1766
+ " $$ref" : " https://smartbear.com/#/components/schemas/Pet" ,
1457
1767
" properties" : {
1458
1768
" id" : {
1459
1769
" format" : " int64" ,
@@ -1507,7 +1817,9 @@ exports[`resolve OpenAPI 3.1.0 strategy given OpenAPI 3.1.0 definition via spec
1507
1817
" content" : {
1508
1818
" application/json" : {
1509
1819
" schema" : {
1820
+ " $$ref" : " https://smartbear.com/#/components/schemas/Pets" ,
1510
1821
" items" : {
1822
+ " $$ref" : " https://smartbear.com/#/components/schemas/Pet" ,
1511
1823
" properties" : {
1512
1824
" id" : {
1513
1825
" format" : " int64" ,
@@ -1545,6 +1857,7 @@ exports[`resolve OpenAPI 3.1.0 strategy given OpenAPI 3.1.0 definition via spec
1545
1857
" content" : {
1546
1858
" application/json" : {
1547
1859
" schema" : {
1860
+ " $$ref" : " https://smartbear.com/#/components/schemas/Error" ,
1548
1861
" properties" : {
1549
1862
" code" : {
1550
1863
" format" : " int32" ,
@@ -1585,6 +1898,7 @@ exports[`resolve OpenAPI 3.1.0 strategy given OpenAPI 3.1.0 definition via spec
1585
1898
" content" : {
1586
1899
" application/json" : {
1587
1900
" schema" : {
1901
+ " $$ref" : " https://smartbear.com/#/components/schemas/Error" ,
1588
1902
" properties" : {
1589
1903
" code" : {
1590
1904
" format" : " int32" ,
@@ -1640,6 +1954,7 @@ exports[`resolve OpenAPI 3.1.0 strategy given OpenAPI 3.1.0 definition via spec
1640
1954
" content" : {
1641
1955
" application/json" : {
1642
1956
" schema" : {
1957
+ " $$ref" : " https://smartbear.com/#/components/schemas/Pet" ,
1643
1958
" properties" : {
1644
1959
" id" : {
1645
1960
" format" : " int64" ,
@@ -1666,6 +1981,7 @@ exports[`resolve OpenAPI 3.1.0 strategy given OpenAPI 3.1.0 definition via spec
1666
1981
" content" : {
1667
1982
" application/json" : {
1668
1983
" schema" : {
1984
+ " $$ref" : " https://smartbear.com/#/components/schemas/Error" ,
1669
1985
" properties" : {
1670
1986
" code" : {
1671
1987
" format" : " int32" ,
0 commit comments