You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In order to do schema validation for request body against swagger specification body definition, we have body validator in swagger-validator module. However, it depends on the BodyHandler to parse the body stream into map/list and put the Java object into an exchange attachment. This will require that BodyHandler must be existed in the request/response chain before RequestValidator. In the light-proxy imeplementation, we cannot consume the body it should be proxied downstream to the backend. Once BodyHandler is disabled, the RequestValidator output and error message that complain the body is missing for post etc. This needs to be resolved to break this kind of hard dependency. What if somebody miss the BodyHandler in their request chain?
The solution is to check if body attachment exists in the exchange or not to decide if body validator is called or not. It means that Body validation is skipped silently if BodyHandler is not working. In order to remind developer the behaviour, an warning log message will be write to the log.
The text was updated successfully, but these errors were encountered:
The following warning will be shown in the log as warning.
Body object doesn't exist in exchange attachment. Most likely the BodyHandler is not in the request chain before RequestValidator or reqeust misses application/json content type header
In order to do schema validation for request body against swagger specification body definition, we have body validator in swagger-validator module. However, it depends on the BodyHandler to parse the body stream into map/list and put the Java object into an exchange attachment. This will require that BodyHandler must be existed in the request/response chain before RequestValidator. In the light-proxy imeplementation, we cannot consume the body it should be proxied downstream to the backend. Once BodyHandler is disabled, the RequestValidator output and error message that complain the body is missing for post etc. This needs to be resolved to break this kind of hard dependency. What if somebody miss the BodyHandler in their request chain?
The solution is to check if body attachment exists in the exchange or not to decide if body validator is called or not. It means that Body validation is skipped silently if BodyHandler is not working. In order to remind developer the behaviour, an warning log message will be write to the log.
The text was updated successfully, but these errors were encountered: