{"action":"created","issue":{"url":"https://api.github.com/repos/kristianmandrup/json-schema-to-yup/issues/2","repository_url":"https://api.github.com/repos/kristianmandrup/json-schema-to-yup","labels_url":"https://api.github.com/repos/kristianmandrup/json-schema-to-yup/issues/2/labels{/name}","comments_url":"https://api.github.com/repos/kristianmandrup/json-schema-to-yup/issues/2/comments","events_url":"https://api.github.com/repos/kristianmandrup/json-schema-to-yup/issues/2/events","html_url":"https://github.com/kristianmandrup/json-schema-to-yup/issues/2","id":378216439,"node_id":"MDU6SXNzdWUzNzgyMTY0Mzk=","number":2,"title":"Always returns valid","user":{"login":"matthewfaircliff","id":36621388,"node_id":"MDQ6VXNlcjM2NjIxMzg4","avatar_url":"https://avatars1.githubusercontent.com/u/36621388?v=4","gravatar_id":"","url":"https://api.github.com/users/matthewfaircliff","html_url":"https://github.com/matthewfaircliff","followers_url":"https://api.github.com/users/matthewfaircliff/followers","following_url":"https://api.github.com/users/matthewfaircliff/following{/other_user}","gists_url":"https://api.github.com/users/matthewfaircliff/gists{/gist_id}","starred_url":"https://api.github.com/users/matthewfaircliff/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/matthewfaircliff/subscriptions","organizations_url":"https://api.github.com/users/matthewfaircliff/orgs","repos_url":"https://api.github.com/users/matthewfaircliff/repos","events_url":"https://api.github.com/users/matthewfaircliff/events{/privacy}","received_events_url":"https://api.github.com/users/matthewfaircliff/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2018-11-07T09:57:42Z","updated_at":"2018-11-07T11:11:13Z","closed_at":null,"author_association":"NONE","body":"Hi,\r\n\r\nThanks for an amazing project. This is just what we need. Only problem is we are only getting valid results when using the library:\r\n\r\n```var jsonSchemaToYup = require(\"json-schema-to-yup\")\r\n\r\nconst json = {\r\n  \"title\":\"users\",\r\n  \"type\":\"object\",\r\n  \"required\": [\"username\",\"first_name\",\"last_name\",\"id_number\"],\r\n  \"properties\":{\r\n    \"username\":{\"type\":\"string\",\"required\":true},\r\n    \"first_name\":{\"type\":\"string\",\"required\":true},\r\n    \"last_name\":{\"type\":\"string\",\"required\":true},\r\n    \"id_number\":{\"type\":\"string\",\"minLength\":12,\"maxLength\":13,\"required\":true}\r\n  }\r\n}\r\n\r\nconst yupSchema = jsonSchemaToYup.buildYup(json);\r\n//console.log(yupSchema)\r\nconst valid = yupSchema.isValidSync({\r\n    \"username\": 123,\r\n    \"foo\": \"bar\",\r\n    \"erm\": [ \"this\", \"that\" ]\r\n});\r\n\r\nconsole.log('Is it valid:' + JSON.stringify(valid))\r\n```\r\n\r\nIs there something wrong with the above? It surely should return `false`?"},"comment":{"url":"https://api.github.com/repos/kristianmandrup/json-schema-to-yup/issues/comments/436589544","html_url":"https://github.com/kristianmandrup/json-schema-to-yup/issues/2#issuecomment-436589544","issue_url":"https://api.github.com/repos/kristianmandrup/json-schema-to-yup/issues/2","id":436589544,"node_id":"MDEyOklzc3VlQ29tbWVudDQzNjU4OTU0NA==","user":{"login":"matthewfaircliff","id":36621388,"node_id":"MDQ6VXNlcjM2NjIxMzg4","avatar_url":"https://avatars1.githubusercontent.com/u/36621388?v=4","gravatar_id":"","url":"https://api.github.com/users/matthewfaircliff","html_url":"https://github.com/matthewfaircliff","followers_url":"https://api.github.com/users/matthewfaircliff/followers","following_url":"https://api.github.com/users/matthewfaircliff/following{/other_user}","gists_url":"https://api.github.com/users/matthewfaircliff/gists{/gist_id}","starred_url":"https://api.github.com/users/matthewfaircliff/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/matthewfaircliff/subscriptions","organizations_url":"https://api.github.com/users/matthewfaircliff/orgs","repos_url":"https://api.github.com/users/matthewfaircliff/repos","events_url":"https://api.github.com/users/matthewfaircliff/events{/privacy}","received_events_url":"https://api.github.com/users/matthewfaircliff/received_events","type":"User","site_admin":false},"created_at":"2018-11-07T11:11:13Z","updated_at":"2018-11-07T11:11:13Z","author_association":"NONE","body":"Thanks Kristian. Will do. \r\n\r\nI have taken some core code out of the repo and got it working in an abstracted fashion in our current project, which solved the immediate problem. Will work on this issue sometime later this week."}}
{"actor":{"display_login":"matthewfaircliff"}}