Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fixes #117 #118

Merged
merged 3 commits into from
Nov 19, 2019
Merged

fixes #117 #118

merged 3 commits into from
Nov 19, 2019

Conversation

GavinChenYan
Copy link
Contributor

No description provided.

Copy link
Contributor

@ddobrin ddobrin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ChenYan71 : there is a second problem here, which IO was looking into fixing today. discussed it with @stevehu yesterday:

  • the RequestValidator "is a" MiddlewareHandler, which in turn is a LightHttpHandler.

Setting the status code only, without calling the LightHttpHandler.setExchangeStatus(), will preclude us from saving the error for auditing purposes.

Ex.:
ValidatorHandler - l.80 - setExchangeStatus(exchange, ...);
is preferable.

At this time, in case of an OpenAPI validation failure, my client can't audit the failure.

Do you wish to change that as well?

@GavinChenYan
Copy link
Contributor Author

@ddobrin I will take a look

@stevehu
Copy link
Contributor

stevehu commented Nov 18, 2019

@ChenYan71 @ddobrin Do you think we should call the validateRequestBody if the contentType is null? I am thinking that we only need to validate if the header is application/json only; however, there might be the case that the user forgets to put the contentType header and we want to catch the error with the validation.

@stevehu stevehu merged commit 9aa9a83 into 1.6.x Nov 19, 2019
@stevehu stevehu deleted the issue_117 branch November 19, 2019 01:06
@GavinChenYan
Copy link
Contributor Author

@stevehu @ddobrin
Light-rest-4j is used for restful API and if user enabled openapi validation from config file means user defined the API specification by openapi. In this case, if the request header didn't specify contentType, the default contentType should be treat as application/json

stevehu pushed a commit that referenced this pull request Nov 19, 2019
* fixes #117

* fixes #117

*  add one more fix for audit the request validation result
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants