-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Add check for input shape #3158
Conversation
bf42d93
to
afa2cd4
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is the issue due to the content in "data" field misaligns with the "shape" field of the input? If so, it seems to be the same issue that this FIXME refers to. I think it is better to have a explicit check instead of what is suggested in the FIXME, but you should clean up the FIXME and related section as your change will address them.
1afa59b
to
de4af8a
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Otherwise looks good except for one more change. And @NonStatic2014 raised a point that we should add test coverage, testing with invalid request JSON, around it. You can add it to this PR or open a follow-up PR for that
e3a866c
to
84c7e8a
Compare
qa/L0_http/test.sh
Outdated
@@ -367,6 +367,34 @@ if [ `grep -c "\[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\]" ./curl.out` != "1" ]; then | |||
RET=1 | |||
fi | |||
|
|||
# send bad request with invalid json |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The json itself is not invalid. Fix:
Send bad request where the 'data' field misaligns with the 'shape' field of the input
src/servers/http_server.cc
Outdated
"Unable to parse 'data'"); | ||
break; | ||
} | ||
// Check if 'ReadDataFromJsonHelper' reads |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Run formatter
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also add empty line before this comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor formatting else LGTM
cf037c8
to
0bf6298
Compare
Should fix the issue #3119