{"action":"opened","issue":{"url":"https://api.github.com/repos/jdorn/json-editor/issues/503","labels_url":"https://api.github.com/repos/jdorn/json-editor/issues/503/labels{/name}","comments_url":"https://api.github.com/repos/jdorn/json-editor/issues/503/comments","events_url":"https://api.github.com/repos/jdorn/json-editor/issues/503/events","html_url":"https://github.com/jdorn/json-editor/issues/503","id":102201497,"number":503,"title":"Add option for a non-global custom validator","user":{"login":"gerrat","id":2641182,"avatar_url":"https://avatars.githubusercontent.com/u/2641182?v=3","gravatar_id":"","url":"https://api.github.com/users/gerrat","html_url":"https://github.com/gerrat","followers_url":"https://api.github.com/users/gerrat/followers","following_url":"https://api.github.com/users/gerrat/following{/other_user}","gists_url":"https://api.github.com/users/gerrat/gists{/gist_id}","starred_url":"https://api.github.com/users/gerrat/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gerrat/subscriptions","organizations_url":"https://api.github.com/users/gerrat/orgs","repos_url":"https://api.github.com/users/gerrat/repos","events_url":"https://api.github.com/users/gerrat/events{/privacy}","received_events_url":"https://api.github.com/users/gerrat/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-08-20T18:25:07Z","updated_at":"2015-08-20T18:25:07Z","closed_at":null,"body":"It appears that the only way to add a custom validator is by making a `global` custom_validator via:\r\n\"JSONEditor.defaults.custom_validators.push(...\"\r\n(eg. https://github.com/jdorn/json-editor#custom-validation)\r\n\r\n*Every* editor then gets this *custom* validator.\r\n\r\nIt would be helpful to be able to attach a specific validator function to an instance of an editor (instead of the global JSONEditor), as an initial option.\r\n\r\nMy apologies if this option already exists, thanks.\r\n"}}