{"action":"created","issue":{"url":"https://api.github.com/repos/spacetelescope/understanding-json-schema/issues/49","labels_url":"https://api.github.com/repos/spacetelescope/understanding-json-schema/issues/49/labels{/name}","comments_url":"https://api.github.com/repos/spacetelescope/understanding-json-schema/issues/49/comments","events_url":"https://api.github.com/repos/spacetelescope/understanding-json-schema/issues/49/events","html_url":"https://github.com/spacetelescope/understanding-json-schema/issues/49","id":120554055,"number":49,"title":"[Question] Tuple validation with enum in the first","user":{"login":"eternaltyro","id":230743,"avatar_url":"https://avatars.githubusercontent.com/u/230743?v=3","gravatar_id":"","url":"https://api.github.com/users/eternaltyro","html_url":"https://github.com/eternaltyro","followers_url":"https://api.github.com/users/eternaltyro/followers","following_url":"https://api.github.com/users/eternaltyro/following{/other_user}","gists_url":"https://api.github.com/users/eternaltyro/gists{/gist_id}","starred_url":"https://api.github.com/users/eternaltyro/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eternaltyro/subscriptions","organizations_url":"https://api.github.com/users/eternaltyro/orgs","repos_url":"https://api.github.com/users/eternaltyro/repos","events_url":"https://api.github.com/users/eternaltyro/events{/privacy}","received_events_url":"https://api.github.com/users/eternaltyro/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-12-05T13:26:45Z","updated_at":"2015-12-05T14:41:09Z","closed_at":null,"body":"In the following schema,\r\n\r\n    { \"type\": \"array\",\r\n      \"items\": [\r\n    { \"type\": \"number\" },\r\n    { \"type\": \"string\" },\r\n    { \"type\": \"string\",\r\n      \"enum\": [\"Street\", \"Avenue\", \"Boulevard\"] },\r\n    { \"type\": \"string\" } ] }\r\n\r\nI'm trying to validate this: [1600, \"Pennsylvania\", \"Avenue\", \"NW\"] \r\n\r\nNow, the documentation explains that it's okay to leave out items. What happens if I leave out the third item `\"Avenue\"`. It would not validate the JSON because `\"NW\"` is not enumerated in the schema? This would especially get more interesting if the first item is `enum` .  Like so:\r\n\r\n    { \"type\":\"array\",\r\n      \"items\": [\r\n      { \"type\": \"string\",\r\n      \"enum\": [ \"Alice\", \"Bob\", \"Eve\", \"Mallory\" ] },\r\n      { \"type\": \"string\"} ]\r\n    }\r\n\r\nIs there a way I can work around this problem? "},"comment":{"url":"https://api.github.com/repos/spacetelescope/understanding-json-schema/issues/comments/162198730","html_url":"https://github.com/spacetelescope/understanding-json-schema/issues/49#issuecomment-162198730","issue_url":"https://api.github.com/repos/spacetelescope/understanding-json-schema/issues/49","id":162198730,"user":{"login":"eternaltyro","id":230743,"avatar_url":"https://avatars.githubusercontent.com/u/230743?v=3","gravatar_id":"","url":"https://api.github.com/users/eternaltyro","html_url":"https://github.com/eternaltyro","followers_url":"https://api.github.com/users/eternaltyro/followers","following_url":"https://api.github.com/users/eternaltyro/following{/other_user}","gists_url":"https://api.github.com/users/eternaltyro/gists{/gist_id}","starred_url":"https://api.github.com/users/eternaltyro/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eternaltyro/subscriptions","organizations_url":"https://api.github.com/users/eternaltyro/orgs","repos_url":"https://api.github.com/users/eternaltyro/repos","events_url":"https://api.github.com/users/eternaltyro/events{/privacy}","received_events_url":"https://api.github.com/users/eternaltyro/received_events","type":"User","site_admin":false},"created_at":"2015-12-05T14:41:09Z","updated_at":"2015-12-05T14:41:09Z","body":"One obvious fix would be to always use the enum in the end. But if there are multiple enums, then it gets complicated."}}