-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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 body validation to update follower index API endpoint. #63653
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -164,6 +164,18 @@ export const registerFollowerIndexRoutes = ({ router, __LEGACY }: RouteDependenc | |
path: `${API_BASE_PATH}/follower_indices/{id}`, | ||
validate: { | ||
params: schema.object({ id: schema.string() }), | ||
body: schema.object({ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It would be better to declare the schema outside the route handler so we can re-use and compose it for the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I've done this in #62890, so I'm going to leave it out of this PR. |
||
maxReadRequestOperationCount: schema.maybe(schema.number()), | ||
maxOutstandingReadRequests: schema.maybe(schema.number()), | ||
maxReadRequestSize: schema.maybe(schema.string()), // byte value | ||
maxWriteRequestOperationCount: schema.maybe(schema.number()), | ||
maxWriteRequestSize: schema.maybe(schema.string()), // byte value | ||
maxOutstandingWriteRequests: schema.maybe(schema.number()), | ||
maxWriteBufferCount: schema.maybe(schema.number()), | ||
maxWriteBufferSize: schema.maybe(schema.string()), // byte value | ||
maxRetryDelay: schema.maybe(schema.string()), // time value | ||
readPollTimeout: schema.maybe(schema.string()), // time value | ||
}), | ||
}, | ||
}, | ||
licensePreRoutingFactory({ | ||
|
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.
Nit: the
stringify
is not needed anymore as the httpClient takes care of it.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.
Hm, do you know whether this is also the case for public side httpClient? I seem to recall the JSON.stringify being required there.
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.
I just did a test and confirmed we still need to stringify the body.