validator icon indicating copy to clipboard operation
validator copied to clipboard

Validate nested maps with unknown keys

Open marawannwh opened this issue 4 years ago • 2 comments

Package version v10

Question:

Is there a way to validate nested maps with unknown keys?

Something like the following:

rules := map[string]interface{
  "params": map[string]interface{
    "*": map[string]interface{
      "id": "required",
      "value": "number",
    }
  }
}  

So parameters could be nil, if not, the key could be anything, but if it does exist, it has to have id and a number value.

marawannwh avatar Sep 08 '21 18:09 marawannwh

hi. Any news?

voronovmaksim avatar Feb 20 '24 17:02 voronovmaksim

I don't even remember what was that for.

marawannwh avatar Feb 20 '24 18:02 marawannwh