{"action":"created","issue":{"url":"https://api.github.com/repos/jquense/yup/issues/55","repository_url":"https://api.github.com/repos/jquense/yup","labels_url":"https://api.github.com/repos/jquense/yup/issues/55/labels{/name}","comments_url":"https://api.github.com/repos/jquense/yup/issues/55/comments","events_url":"https://api.github.com/repos/jquense/yup/issues/55/events","html_url":"https://github.com/jquense/yup/issues/55","id":161145869,"number":55,"title":"Strip and noUnknown","user":{"login":"jacobp100","id":7275322,"avatar_url":"https://avatars.githubusercontent.com/u/7275322?v=3","gravatar_id":"","url":"https://api.github.com/users/jacobp100","html_url":"https://github.com/jacobp100","followers_url":"https://api.github.com/users/jacobp100/followers","following_url":"https://api.github.com/users/jacobp100/following{/other_user}","gists_url":"https://api.github.com/users/jacobp100/gists{/gist_id}","starred_url":"https://api.github.com/users/jacobp100/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jacobp100/subscriptions","organizations_url":"https://api.github.com/users/jacobp100/orgs","repos_url":"https://api.github.com/users/jacobp100/repos","events_url":"https://api.github.com/users/jacobp100/events{/privacy}","received_events_url":"https://api.github.com/users/jacobp100/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2016-06-20T08:50:10Z","updated_at":"2016-06-20T11:23:41Z","closed_at":null,"body":"I'm trying to achieve the following.\r\n\r\n```js\r\nconst testSchema = yup.object().shape({\r\n  id: yup.mixed().strip(),\r\n  name: yup.string(),\r\n}).noUnknown();\r\n\r\nconst schemaOptions = {\r\n  abortEarly: false,\r\n  strict: true,\r\n};\r\n\r\ntest('id is stripped', t => (\r\n  testSchema.validate(\r\n    inputParams,\r\n    schemaOptions,\r\n    { id: 'test', name: 'test' }\r\n  ).then(params => {\r\n    t.false('id' in params);\r\n    t.true('test' in params);\r\n  });\r\n));\r\n\r\ntest('unknown keys fail', t => (\r\n  testSchema.validate(\r\n    inputParams,\r\n    schemaOptions,\r\n    { unknownKey: true }\r\n  ).catch(() => {\r\n    t.pass();\r\n  });\r\n));\r\n```\r\n\r\nI can't seem to get the test to pass, no matter what I do for `schemaOptions`. Am I doing something wrong?"},"comment":{"url":"https://api.github.com/repos/jquense/yup/issues/comments/227116441","html_url":"https://github.com/jquense/yup/issues/55#issuecomment-227116441","issue_url":"https://api.github.com/repos/jquense/yup/issues/55","id":227116441,"user":{"login":"jquense","id":339286,"avatar_url":"https://avatars.githubusercontent.com/u/339286?v=3","gravatar_id":"","url":"https://api.github.com/users/jquense","html_url":"https://github.com/jquense","followers_url":"https://api.github.com/users/jquense/followers","following_url":"https://api.github.com/users/jquense/following{/other_user}","gists_url":"https://api.github.com/users/jquense/gists{/gist_id}","starred_url":"https://api.github.com/users/jquense/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jquense/subscriptions","organizations_url":"https://api.github.com/users/jquense/orgs","repos_url":"https://api.github.com/users/jquense/repos","events_url":"https://api.github.com/users/jquense/events{/privacy}","received_events_url":"https://api.github.com/users/jquense/received_events","type":"User","site_admin":false},"created_at":"2016-06-20T11:23:41Z","updated_at":"2016-06-20T11:23:41Z","body":"`strict` is going to disabled any transformations _like strip or noUnknown_ don't run them in strict mode and it should work. Also `{ unknownKey }` isn't a valid option"}}
{"actor":{"display_login":"jquense"}}