7

Let's suppose that I have this schema:

"array": {
  "type": "array",
  "items": {
    "type": "object",
    "properties": {"id": {"type": "integer"}, "value": {"type": "number"}}
  },
  "uniqueItems": true
}

But I need to ensure that there are no objects with duplicate ids in this array. I don't want two objects with the same ids. Is it possible to define restriction on object uniqueness by its "id" property only?

Andrey Kon
  • 747
  • 2
  • 6
  • 16
  • 1
    possible duplicate of [How to (if possible) define in JSON schema one of array items property shall be unique?](http://stackoverflow.com/questions/24763759/how-to-if-possible-define-in-json-schema-one-of-array-items-property-shall-be) – stackErr Nov 28 '14 at 14:46
  • 3
    And its not possible to do.Since `JSON schema's job is to define data and it shouldn't be concerned with business logic around that data` – stackErr Nov 28 '14 at 14:46

0 Answers0