Details
-
Improvement
-
Resolution: Fixed
-
Major
-
None
-
Security Level: Public
-
None
-
CBG Sprint 12, CBG Sprint 13
-
5
Description
Sync Gateway already has some basic validation on the configuration supplied, which checks that the given config is valid JSON. Some specific properties have validation on the values, but checking for unknown fields would catch a multitude of errors, ranging from copy/paste errors, typos, and also usage of old/removed options.
We have the option of setting Decoder.DisallowUnknownFields() when decoding the server config in ReadServerConfigFromFile and ReadServerConfigFromUrl, to strictly validate that the given JSON matches theĀ ServerConfig struct, with no additional, or misspelled fields.
Other tasks to carry out as part of this issue are:
- Checking that each of the configs in examples passes the validation.
- Making sure the error is descriptive enough that somebody can immediately identify it's a config problem, and can identify the offending property
- Calling this out explicitly in the documentation as a new feature. Customers are very likely to encounter errors until their configs are cleaned.
Related GitHub issues: