Question

I've got a JSON schema:

{
  "required": ["name", "description"],
  "properties": {
    "name": { "type": "string" },
    "description": { "type": "string" },
    "meta": { "type": "object" }
  }
}

How do I specify that the meta nested object can contain absolutely anything?

Était-ce utile?

La solution

Just leave the schema empty:

{
  "required": ["name", "description"],
  "properties": {
    "name": {"type": "string"},
    "description": {"type": "string"},
    "meta": {}
  }
}

If you don't specify any constraints, then anything goes!

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top