Skip to content

JSON Schema for a list of objects that must contain one of three default props #126

Answered by musemind
Roni-Ravin asked this question in Q&A
Discussion options

You must be logged in to vote

maybe try this:

{
  "type": "array",
  "items": {
    "type": "object",
    "additionalProperties": false,
    "properties": {
      "provider_metadata_id": {
        "type": "number"
      }
    }
  },
  "contains": {
    "type": "object",
    "properties": {
      "provider_metadata_id": {
        "enum": [1, 77, 90]
      }
    }
  }
}

Replies: 4 comments 14 replies

Comment options

You must be logged in to vote
4 replies
@Roni-Ravin
Comment options

@musemind
Comment options

@Roni-Ravin
Comment options

@Roni-Ravin
Comment options

Answer selected by Relequestual
Comment options

You must be logged in to vote
6 replies
@Roni-Ravin
Comment options

@Roni-Ravin
Comment options

@musemind
Comment options

@karenetheridge
Comment options

@Roni-Ravin
Comment options

Comment options

You must be logged in to vote
1 reply
@Roni-Ravin
Comment options

Comment options

You must be logged in to vote
3 replies
@karenetheridge
Comment options

@Roni-Ravin
Comment options

@karenetheridge
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants