// Running Discourse Development Environment //
I have the following:
min_score:
default: 0.01
client: true
min: 0.0001
But the admin can keep overwriting it to negative values, is there a workaround for this?
The discussion revolves around specifying a min and max for settings.yml in a Discourse plugin. bstgmr02 is trying to restrict the min_score setting to a minimum value of 0.0001 but is encountering issues where the admin can still input negative values.
bstgmr02 tried adding type: float to the setting, but it had no effect. Arkshine suggested adding type: float, but this solution did not work.
bstgmr02 found that when an invalid number is entered, the value resets to 0.0 upon refreshing, but no errors are displayed. Custom validation seems to work, but default validation for min/max is not functioning as expected.
After further testing, bstgmr02 discovered that the issue seems to be specific to type: float and may be a bug on Discourse’s side, as it also affects the Chat plugin. The min/max validation only appears to work for type: integer.
// Running Discourse Development Environment //
I have the following:
min_score:
default: 0.01
client: true
min: 0.0001
But the admin can keep overwriting it to negative values, is there a workaround for this?
I could not reproduce your setting as it is:

Can you try adding type: float?
I’m not sure it’s required, as I believe basic types are guessed automatically.
Your screenshot is not showing the minimum_tip setting.
Was just a typo in my post, has been updated. Issue still remains.
Weird thing is that it resets the value to back to 0.0 when I enter an invalid number but only upon refreshing. But no errors are appearing on the UI side either way.
Bump.
Custom validation seems to work and error out, however I have no luck with the default validation of min/max.
Anyone have any ideas?
After some further testing, it seems like it does not work for type: float, and only works for type: integer. However, a user can freely input anything apart from an integer - which requires a hard refresh and results in the value resetting to 0.
Seems like a bug/error on Discourse’s side? It also seems to affect the Chat plugin.