-
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
Use schema.never()
for dev/!dist config parameters
#110239
Comments
Pinging @elastic/kibana-core (Team:Core) |
Imho having an explicit error message is more important than an technical implementation detail, so id I had to choose, I'd say to keep the current code. |
That brings me to the next question: since the only thing stopping us from using |
Not sure I really like allowing custom error messages for joi types, as it can lead to some overcomplicated things. OTOH, for kibana/packages/kbn-config-schema/src/types/never_type.ts Lines 13 to 22 in 4584a8b
|
Alternatively, we could improve the default error message to That sounds like a lot of work (and users probably will wonder how to set I think the What do you think? |
Realistically, it can't be automated, as the amount of work to parse the JOI schema tree would be enormous. So the only option for such specific message would be the |
The effort / upside level feels fairly low on that one, we will realistically never pick it up, so I'm going to close it. If anyone wants to self-assign, feel free to reopen. |
Related discussion: #107663 (comment)
Should we set
schema.never()
instead ofschema.boolean({ validate: (rawValue) => if (rawValue === true) return 'validation error message'; })
for those config entries that are not supported in production?The text was updated successfully, but these errors were encountered: