@@ -41,6 +41,11 @@ public class OpenApiValidator {
41
41
final String VALIDATOR_REQUEST_PARAMETER_MISSING = "ERR11001" ;
42
42
43
43
44
+ final String VALIDATOR_REQUEST_PARAMETER_PATH_MISSING = "ERR11108" ;
45
+ final String VALIDATOR_REQUEST_PARAMETER_HEADER_MISSING = "ERR11017" ;
46
+ final String VALIDATOR_REQUEST_PARAMETER_QUERY_MISSING = "ERR11000" ;
47
+
48
+
44
49
public String spec ;
45
50
public OpenApiHelper openApiHelper ;
46
51
public SchemaValidator schemaValidator ;
@@ -203,7 +208,7 @@ private Status validatePathParameters(final RequestEntity requestEntity, final N
203
208
return result .getStatus ();
204
209
}
205
210
if (result .skippedParameters !=null && !result .skippedParameters .isEmpty ()) {
206
- return result .skippedParameters .stream ().map (p -> new Status (VALIDATOR_REQUEST_PARAMETER_MISSING , p .getName (), openApiOperation .getPathString ().original ()))
211
+ return result .skippedParameters .stream ().map (p -> new Status (VALIDATOR_REQUEST_PARAMETER_PATH_MISSING , p .getName (), openApiOperation .getPathString ().original ()))
207
212
.filter (s ->s != null ).findFirst ().get ();
208
213
}
209
214
return null ;
@@ -253,7 +258,7 @@ private Status validateQueryParameters(final RequestEntity requestEntity, final
253
258
return result .getStatus ();
254
259
}
255
260
if (result .skippedParameters !=null && !result .skippedParameters .isEmpty ()) {
256
- return result .skippedParameters .stream ().map (p -> new Status (VALIDATOR_REQUEST_PARAMETER_MISSING , p .getName (), openApiOperation .getPathString ().original ()))
261
+ return result .skippedParameters .stream ().map (p -> new Status (VALIDATOR_REQUEST_PARAMETER_QUERY_MISSING , p .getName (), openApiOperation .getPathString ().original ()))
257
262
.filter (s ->s != null ).findFirst ().get ();
258
263
}
259
264
return null ;
@@ -281,7 +286,7 @@ private Optional<Status> validatePathLevelHeaders(final RequestEntity requestEnt
281
286
return Optional .ofNullable (result .getStatus ());
282
287
}
283
288
if (result .skippedParameters !=null && !result .skippedParameters .isEmpty ()) {
284
- return result .skippedParameters .stream ().map (p -> new Status (VALIDATOR_REQUEST_PARAMETER_MISSING , p .getName (), openApiOperation .getPathString ().original ()))
289
+ return result .skippedParameters .stream ().map (p -> new Status (VALIDATOR_REQUEST_PARAMETER_HEADER_MISSING , p .getName (), openApiOperation .getPathString ().original ()))
285
290
.filter (s ->s != null ).findFirst ();
286
291
}
287
292
return Optional .ofNullable (null );
@@ -296,7 +301,7 @@ private Optional<Status> validateOperationLevelHeaders(final RequestEntity reque
296
301
return Optional .ofNullable (result .getStatus ());
297
302
}
298
303
if (result .skippedParameters !=null && !result .skippedParameters .isEmpty ()) {
299
- return result .skippedParameters .stream ().map (p -> new Status (VALIDATOR_REQUEST_PARAMETER_MISSING , p .getName (), openApiOperation .getPathString ().original ()))
304
+ return result .skippedParameters .stream ().map (p -> new Status (VALIDATOR_REQUEST_PARAMETER_HEADER_MISSING , p .getName (), openApiOperation .getPathString ().original ()))
300
305
.filter (s ->s != null ).findFirst ();
301
306
}
302
307
return Optional .ofNullable (null );
0 commit comments