[kbn/config-schema] Improve OneOf error message format #84264
Labels
enhancement
New value added to drive a business result
kbn/config-schema
Team:Core
Core services & architecture: plugins, logging, config, saved objects, http, ES client, i18n, etc
The current error message for the failed
.oneOf
method is cryptic and not user friendly:kibana/x-pack/plugins/security/server/config.test.ts
Lines 992 to 1000 in 1cc1d8c
It's hard to reason about it. While the error doesn't provide details of the valid format (see https://github.com/elastic/kibana/blob/e3ca8a928dbb5fe2b844497a62f8875c8656deb5/x-pack/plugins/security/server/config.ts):
xpack.securuty.authc.providers
is expected to bestring[] | { [key]:{ description: string, icon: string, showInSelector: string }
xpack.securuty.authc.providers.anonymous.anonymous1.credentials
is expected to be{username: string, password:string} | { apiKey: { id:string, key:string} | string } }
The text was updated successfully, but these errors were encountered: