{"action":"created","issue":{"url":"https://api.github.com/repos/json-schema-faker/json-schema-faker/issues/134","repository_url":"https://api.github.com/repos/json-schema-faker/json-schema-faker","labels_url":"https://api.github.com/repos/json-schema-faker/json-schema-faker/issues/134/labels{/name}","comments_url":"https://api.github.com/repos/json-schema-faker/json-schema-faker/issues/134/comments","events_url":"https://api.github.com/repos/json-schema-faker/json-schema-faker/issues/134/events","html_url":"https://github.com/json-schema-faker/json-schema-faker/issues/134","id":147399068,"number":134,"title":"Allow extending for arbitrary keywords","user":{"login":"charypar","id":1517854,"avatar_url":"https://avatars.githubusercontent.com/u/1517854?v=3","gravatar_id":"","url":"https://api.github.com/users/charypar","html_url":"https://github.com/charypar","followers_url":"https://api.github.com/users/charypar/followers","following_url":"https://api.github.com/users/charypar/following{/other_user}","gists_url":"https://api.github.com/users/charypar/gists{/gist_id}","starred_url":"https://api.github.com/users/charypar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/charypar/subscriptions","organizations_url":"https://api.github.com/users/charypar/orgs","repos_url":"https://api.github.com/users/charypar/repos","events_url":"https://api.github.com/users/charypar/events{/privacy}","received_events_url":"https://api.github.com/users/charypar/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":6,"created_at":"2016-04-11T11:29:13Z","updated_at":"2016-04-11T15:53:43Z","closed_at":null,"body":"Rather than opening a PR out of the blue, I thought I'd ask first: \r\n\r\nIn our project, we use `json-schema-faker` to generate fake data according to a schema, however, because the data are used as React component props, we have some extensions in the schema itself for objects that are not strictly JSON. \r\nIn order to extend the basic JSON schema, because extending with custom `type` [is against the spec](http://json-schema.org/latest/json-schema-validation.html#anchor79), we define custom keywords for custom things (e.g. `{ isFunction: true }` instead of `{ type: 'function' }`).\r\n\r\nWhile I know this is controversial and we probably shouldn't, the overwhelming majority of prop data is covered by JSON schema and the interoperability of it is extremely appealing.\r\n\r\nJSON schema faker currently doesn't support extending for custom keywords, but the support is \"almost there\". If [`external` type detection](https://github.com/json-schema-faker/json-schema-faker/blob/master/lib/core/traverse.js#L20) looked at available extensions in `container` and the `external` type then [delegated to any extension here](https://github.com/json-schema-faker/json-schema-faker/blob/master/lib/types/external.js#L25) (probably in order from last one defined to first one defined), it should be quite easy to do this. Unless I'm missing something.\r\n\r\nIs that something you'd be willing to accept as a PR?\r\n"},"comment":{"url":"https://api.github.com/repos/json-schema-faker/json-schema-faker/issues/comments/208417041","html_url":"https://github.com/json-schema-faker/json-schema-faker/issues/134#issuecomment-208417041","issue_url":"https://api.github.com/repos/json-schema-faker/json-schema-faker/issues/134","id":208417041,"user":{"login":"charypar","id":1517854,"avatar_url":"https://avatars.githubusercontent.com/u/1517854?v=3","gravatar_id":"","url":"https://api.github.com/users/charypar","html_url":"https://github.com/charypar","followers_url":"https://api.github.com/users/charypar/followers","following_url":"https://api.github.com/users/charypar/following{/other_user}","gists_url":"https://api.github.com/users/charypar/gists{/gist_id}","starred_url":"https://api.github.com/users/charypar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/charypar/subscriptions","organizations_url":"https://api.github.com/users/charypar/orgs","repos_url":"https://api.github.com/users/charypar/repos","events_url":"https://api.github.com/users/charypar/events{/privacy}","received_events_url":"https://api.github.com/users/charypar/received_events","type":"User","site_admin":false},"created_at":"2016-04-11T15:53:43Z","updated_at":"2016-04-11T15:53:43Z","body":"I don't want it to understand them, but I would like to be able to extend `jsf` (using `jsf.extend`) to understand them in a similar way it's possible to currently extend `faker` and `chance`. \r\n\r\nIn fact it would be useful in order to eventually get rid of those optional dependencies altogether, because you could just use them like any other custom data generator."}}