{"action":"created","issue":{"url":"https://api.github.com/repos/jquense/yup/issues/176","repository_url":"https://api.github.com/repos/jquense/yup","labels_url":"https://api.github.com/repos/jquense/yup/issues/176/labels{/name}","comments_url":"https://api.github.com/repos/jquense/yup/issues/176/comments","events_url":"https://api.github.com/repos/jquense/yup/issues/176/events","html_url":"https://github.com/jquense/yup/issues/176","id":298481774,"node_id":"MDU6SXNzdWUyOTg0ODE3NzQ=","number":176,"title":"How to conditionally validate at least one of n values are set?","user":{"login":"nandastone","id":199204,"node_id":"MDQ6VXNlcjE5OTIwNA==","avatar_url":"https://avatars0.githubusercontent.com/u/199204?v=4","gravatar_id":"","url":"https://api.github.com/users/nandastone","html_url":"https://github.com/nandastone","followers_url":"https://api.github.com/users/nandastone/followers","following_url":"https://api.github.com/users/nandastone/following{/other_user}","gists_url":"https://api.github.com/users/nandastone/gists{/gist_id}","starred_url":"https://api.github.com/users/nandastone/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nandastone/subscriptions","organizations_url":"https://api.github.com/users/nandastone/orgs","repos_url":"https://api.github.com/users/nandastone/repos","events_url":"https://api.github.com/users/nandastone/events{/privacy}","received_events_url":"https://api.github.com/users/nandastone/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":12,"created_at":"2018-02-20T06:07:55Z","updated_at":"2019-06-10T21:27:56Z","closed_at":"2018-03-02T13:51:12Z","author_association":"NONE","body":"I have 5 form fields, at last one of which must be populated for validation to succeed. I attempted this, but soon ran into cyclic reference issues:\r\n\r\n```\r\ntag_business: yup.string().when(['tag_cost_centre', 'tag_project_code', 'tag_internal_order', 'tag_business'], {\r\n  is: (tag_cost_centre, tag_project_code, tag_internal_order, tag_business) => {\r\n    return !(tag_cost_centre, tag_project_code, tag_internal_order, tag_business)\r\n  },\r\n  then: yup.string().required()\r\n})\r\n```\r\n\r\nWhat would be the best way to implement this?"},"comment":{"url":"https://api.github.com/repos/jquense/yup/issues/comments/500601806","html_url":"https://github.com/jquense/yup/issues/176#issuecomment-500601806","issue_url":"https://api.github.com/repos/jquense/yup/issues/176","id":500601806,"node_id":"MDEyOklzc3VlQ29tbWVudDUwMDYwMTgwNg==","user":{"login":"dguo","id":2763135,"node_id":"MDQ6VXNlcjI3NjMxMzU=","avatar_url":"https://avatars0.githubusercontent.com/u/2763135?v=4","gravatar_id":"","url":"https://api.github.com/users/dguo","html_url":"https://github.com/dguo","followers_url":"https://api.github.com/users/dguo/followers","following_url":"https://api.github.com/users/dguo/following{/other_user}","gists_url":"https://api.github.com/users/dguo/gists{/gist_id}","starred_url":"https://api.github.com/users/dguo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dguo/subscriptions","organizations_url":"https://api.github.com/users/dguo/orgs","repos_url":"https://api.github.com/users/dguo/repos","events_url":"https://api.github.com/users/dguo/events{/privacy}","received_events_url":"https://api.github.com/users/dguo/received_events","type":"User","site_admin":false},"created_at":"2019-06-10T21:27:56Z","updated_at":"2019-06-10T21:27:56Z","author_association":"NONE","body":"@loolooii, I ran into the same TypeScript issue, and it looks like you just have to upgrade @types/yup to v0.26.14 or later. The issue was fixed in https://github.com/DefinitelyTyped/DefinitelyTyped/pull/35885."}}
{"actor":{"display_login":"dguo"}}