@@ -1428,7 +1428,7 @@ function checkValueAgainstSchema (context, property, jsonPathPrefix, txnParamNam
1428
1428
mismatchObj . suggestedFix = {
1429
1429
key : txnParamName ,
1430
1430
actualValue : valueToUse ,
1431
- suggestedValue : safeSchemaFaker ( context , openApiSchemaObj || { } , PROCESSING_TYPE . VALIDATION ,
1431
+ suggestedValue : safeSchemaFaker ( context , schema || { } , PROCESSING_TYPE . VALIDATION ,
1432
1432
parameterSourceOption , components , SCHEMA_FORMATS . DEFAULT , schemaCache )
1433
1433
} ;
1434
1434
}
@@ -1444,7 +1444,7 @@ function checkValueAgainstSchema (context, property, jsonPathPrefix, txnParamNam
1444
1444
if ( ! _ . isEmpty ( filteredValidationError ) ) {
1445
1445
let mismatchObj ,
1446
1446
suggestedValue ,
1447
- fakedValue = safeSchemaFaker ( context , openApiSchemaObj || { } , PROCESSING_TYPE . VALIDATION ,
1447
+ fakedValue = safeSchemaFaker ( context , schema || { } , PROCESSING_TYPE . VALIDATION ,
1448
1448
parameterSourceOption , components , SCHEMA_FORMATS . DEFAULT , schemaCache ) ;
1449
1449
1450
1450
// Show detailed validation mismatches for only request/response body
@@ -1700,12 +1700,14 @@ function checkPathVariables (context, matchedPathData, transactionPathPrefix, sc
1700
1700
} ;
1701
1701
1702
1702
if ( options . suggestAvailableFixes ) {
1703
+ const resolvedSchema = resolveSchema ( context , pathVar . schema , 0 , PROCESSING_TYPE . VALIDATION ) ;
1704
+
1703
1705
mismatchObj . suggestedFix = {
1704
1706
key : pathVar . name ,
1705
1707
actualValue,
1706
1708
suggestedValue : {
1707
1709
key : pathVar . name ,
1708
- value : safeSchemaFaker ( context , pathVar . schema || { } , PROCESSING_TYPE . VALIDATION ,
1710
+ value : safeSchemaFaker ( context , resolvedSchema || { } , PROCESSING_TYPE . VALIDATION ,
1709
1711
PARAMETER_SOURCE . REQUEST , components , SCHEMA_FORMATS . DEFAULT , schemaCache ) ,
1710
1712
description : getParameterDescription ( pathVar )
1711
1713
}
@@ -1838,12 +1840,14 @@ function checkQueryParams (context, queryParams, transactionPathPrefix, schemaPa
1838
1840
} ;
1839
1841
1840
1842
if ( options . suggestAvailableFixes ) {
1843
+ const resolvedSchema = resolveSchema ( context , qp . schema , 0 , PROCESSING_TYPE . VALIDATION ) ;
1844
+
1841
1845
mismatchObj . suggestedFix = {
1842
1846
key : qp . name ,
1843
1847
actualValue : null ,
1844
1848
suggestedValue : {
1845
1849
key : qp . name ,
1846
- value : safeSchemaFaker ( context , qp . schema || { } , PROCESSING_TYPE . VALIDATION ,
1850
+ value : safeSchemaFaker ( context , resolvedSchema || { } , PROCESSING_TYPE . VALIDATION ,
1847
1851
PARAMETER_SOURCE . REQUEST , components , SCHEMA_FORMATS . DEFAULT , schemaCache ) ,
1848
1852
description : getParameterDescription ( qp )
1849
1853
}
@@ -1960,12 +1964,14 @@ function checkRequestHeaders (context, headers, transactionPathPrefix, schemaPat
1960
1964
} ;
1961
1965
1962
1966
if ( options . suggestAvailableFixes ) {
1967
+ const resolvedSchema = resolveSchema ( context , header . schema , 0 , PROCESSING_TYPE . VALIDATION ) ;
1968
+
1963
1969
mismatchObj . suggestedFix = {
1964
1970
key : header . name ,
1965
1971
actualValue : null ,
1966
1972
suggestedValue : {
1967
1973
key : header . name ,
1968
- value : safeSchemaFaker ( context , header . schema || { } , PROCESSING_TYPE . VALIDATION ,
1974
+ value : safeSchemaFaker ( context , resolvedSchema || { } , PROCESSING_TYPE . VALIDATION ,
1969
1975
PARAMETER_SOURCE . REQUEST , components , SCHEMA_FORMATS . DEFAULT , schemaCache ) ,
1970
1976
description : getParameterDescription ( header )
1971
1977
}
@@ -2078,12 +2084,14 @@ function checkResponseHeaders (context, schemaResponse, headers, transactionPath
2078
2084
} ;
2079
2085
2080
2086
if ( options . suggestAvailableFixes ) {
2087
+ const resolvedSchema = resolveSchema ( context , header . schema , 0 , PROCESSING_TYPE . VALIDATION ) ;
2088
+
2081
2089
mismatchObj . suggestedFix = {
2082
2090
key : header . name ,
2083
2091
actualValue : null ,
2084
2092
suggestedValue : {
2085
2093
key : header . name ,
2086
- value : safeSchemaFaker ( context , header . schema || { } , PROCESSING_TYPE . VALIDATION ,
2094
+ value : safeSchemaFaker ( context , resolvedSchema || { } , PROCESSING_TYPE . VALIDATION ,
2087
2095
PARAMETER_SOURCE . REQUEST , components , SCHEMA_FORMATS . DEFAULT , schemaCache ) ,
2088
2096
description : getParameterDescription ( header )
2089
2097
}
@@ -2248,12 +2256,14 @@ function checkRequestBody (context, requestBody, transactionPathPrefix, schemaPa
2248
2256
} ;
2249
2257
2250
2258
if ( options . suggestAvailableFixes ) {
2259
+ const resolvedSchema = resolveSchema ( context , uParam . schema , 0 , PROCESSING_TYPE . VALIDATION ) ;
2260
+
2251
2261
mismatchObj . suggestedFix = {
2252
2262
key : uParam . name ,
2253
2263
actualValue : null ,
2254
2264
suggestedValue : {
2255
2265
key : uParam . name ,
2256
- value : safeSchemaFaker ( context , uParam . schema || { } , PROCESSING_TYPE . VALIDATION ,
2266
+ value : safeSchemaFaker ( context , resolvedSchema || { } , PROCESSING_TYPE . VALIDATION ,
2257
2267
PARAMETER_SOURCE . REQUEST , components , SCHEMA_FORMATS . DEFAULT , schemaCache ) ,
2258
2268
description : getParameterDescription ( uParam )
2259
2269
}
0 commit comments