How to edit specific keys of dynamic yaml file

Viewed 224

We are developing an prioritization system which uses linear programming and prioritize the data based on multiple constraints. All these dynamic constraints are stored in yaml file and users can request for changing it's values whenever required without modifying code. Now we are developing an UI to modify few constraints without breaking yaml config file with below requirements:

  1. Not all values can be edited.
  2. Few keys are hidden as they are used only by developer.
  3. Few keys are read-only fields which need to be displayed to end user..

I stored all these information in a DB table as below and getting it into java list | key_name | can_edit| can_visible| |-----------------|---------|------------| | key1.key2.key3 | true | true |

Now how can I parse Yaml file by filtering only these values and update it to a new file.

Considering this yaml config file is generic as it should support any kind of yaml file, I cannot create any pojo of every yaml structure. So I need to use some dynamic parser to update and create new file. Please suggest any approach.

0 Answers
Related