json 确保字符串不匹配数组的任何元素的架构

json schema to ensure a string does not match any element of an array

{
  "title":"x",
  "type:"string",
  "doesNotMatch":["element1","element2"]
}

是否有 JSON 架构确保 JSON 数据不会匹配 element1 和 element2。

not enum 应该可以帮到你:

{
  "title":"x",
  "type:"string",
  "not": {"enum":["element1","element2"]}
}