Validate Organization Settings against JSON schema
What does this MR do and why?
Related Issue #394801 (closed)
MR !123380 (merged) introduced JSONB as storage for the settings. Since we store settings as JSON, PostgreSQL is no longer aware of the data types being used. To address that, this MR adds validation of settings
attribute against JSON schema.
We do not use these settings yet. A follow-up MR will start reading and writing the setting.
How to set up and validate locally
- Using Rails console:
Organizations::OrganizationSetting.new(settings: { some_key: 'invalid'}).valid?
should be false -
Organizations::OrganizationSetting.new(settings: { restricted_visibility_levels: [10]}).valid?
should be true
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.
Edited by Rutger Wessels