[8.6] [Enterprise Search] Allow empty config values to be saved (#146278) (#146287)

# Backport

This will backport the following commits from `main` to `8.6`:
- [[Enterprise Search] Allow empty config values to be saved
(#146278)](https://github.com/elastic/kibana/pull/146278)

<!--- Backport version: 8.9.7 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sqren/backport)

<!--BACKPORT [{"author":{"name":"Sander
Philipse","email":"94373878+sphilipse@users.noreply.github.com"},"sourceCommit":{"committedDate":"2022-11-24T12:58:39Z","message":"[Enterprise
Search] Allow empty config values to be saved (#146278)\n\nThis allows
null values for connector configuration values, which was\r\ninitially
breaking some configuration
setting.","sha":"c9eebf262c65d6c3104592b6ea0bb61f1d6e0d1f","branchLabelMapping":{"^v8.7.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","Team:EnterpriseSearch","v8.6.0","v8.7.0"],"number":146278,"url":"https://github.com/elastic/kibana/pull/146278","mergeCommit":{"message":"[Enterprise
Search] Allow empty config values to be saved (#146278)\n\nThis allows
null values for connector configuration values, which was\r\ninitially
breaking some configuration
setting.","sha":"c9eebf262c65d6c3104592b6ea0bb61f1d6e0d1f"}},"sourceBranch":"main","suggestedTargetBranches":["8.6"],"targetPullRequestStates":[{"branch":"8.6","label":"v8.6.0","labelRegex":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v8.7.0","labelRegex":"^v8.7.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/146278","number":146278,"mergeCommit":{"message":"[Enterprise
Search] Allow empty config values to be saved (#146278)\n\nThis allows
null values for connector configuration values, which was\r\ninitially
breaking some configuration
setting.","sha":"c9eebf262c65d6c3104592b6ea0bb61f1d6e0d1f"}}]}]
BACKPORT-->

Co-authored-by: Sander Philipse <94373878+sphilipse@users.noreply.github.com>
This commit is contained in:
Kibana Machine 2022-11-24 09:02:23 -05:00 committed by GitHub
parent d4567dc2ea
commit 9f0e2d6874
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View file

@ -7,7 +7,7 @@
export interface KeyValuePair {
label: string;
value: string;
value: string | null;
}
export type ConnectorConfiguration = Record<string, KeyValuePair | null>;

View file

@ -100,7 +100,7 @@ export function registerConnectorRoutes({ router, log }: RouteDependencies) {
validate: {
body: schema.recordOf(
schema.string(),
schema.object({ label: schema.string(), value: schema.string() })
schema.object({ label: schema.string(), value: schema.nullable(schema.string()) })
),
params: schema.object({
connectorId: schema.string(),