payload: {"action":"created","issue":{"url":"https://api.github.com/repos/cloudnc/ngx-sub-form/issues/91","repository_url":"https://api.github.com/repos/cloudnc/ngx-sub-form","labels_url":"https://api.github.com/repos/cloudnc/ngx-sub-form/issues/91/labels{/name}","comments_url":"https://api.github.com/repos/cloudnc/ngx-sub-form/issues/91/comments","events_url":"https://api.github.com/repos/cloudnc/ngx-sub-form/issues/91/events","html_url":"https://github.com/cloudnc/ngx-sub-form/issues/91","id":482808063,"node_id":"MDU6SXNzdWU0ODI4MDgwNjM=","number":91,"title":"`oneOf` validator for polymorphic data","user":{"login":"maxime1992","id":4950209,"node_id":"MDQ6VXNlcjQ5NTAyMDk=","avatar_url":"https://avatars0.githubusercontent.com/u/4950209?v=4","gravatar_id":"","url":"https://api.github.com/users/maxime1992","html_url":"https://github.com/maxime1992","followers_url":"https://api.github.com/users/maxime1992/followers","following_url":"https://api.github.com/users/maxime1992/following{/other_user}","gists_url":"https://api.github.com/users/maxime1992/gists{/gist_id}","starred_url":"https://api.github.com/users/maxime1992/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/maxime1992/subscriptions","organizations_url":"https://api.github.com/users/maxime1992/orgs","repos_url":"https://api.github.com/users/maxime1992/repos","events_url":"https://api.github.com/users/maxime1992/events{/privacy}","received_events_url":"https://api.github.com/users/maxime1992/received_events","type":"User","site_admin":false},"labels":[{"id":1418905851,"node_id":"MDU6TGFiZWwxNDE4OTA1ODUx","url":"https://api.github.com/repos/cloudnc/ngx-sub-form/labels/effort-2:%20hours","name":"effort-2: hours","color":"9bf2c0","default":false},{"id":1418903652,"node_id":"MDU6TGFiZWwxNDE4OTAzNjUy","url":"https://api.github.com/repos/cloudnc/ngx-sub-form/labels/scope:%20lib","name":"scope: lib","color":"a9bbfc","default":false},{"id":1418914685,"node_id":"MDU6TGFiZWwxNDE4OTE0Njg1","url":"https://api.github.com/repos/cloudnc/ngx-sub-form/labels/state:%20has%20PR","name":"state: has PR","color":"edbf8e","default":false},{"id":1418916727,"node_id":"MDU6TGFiZWwxNDE4OTE2NzI3","url":"https://api.github.com/repos/cloudnc/ngx-sub-form/labels/type:%20feature","name":"type: feature","color":"f7aac8","default":false}],"state":"open","locked":false,"assignee":{"login":"maxime1992","id":4950209,"node_id":"MDQ6VXNlcjQ5NTAyMDk=","avatar_url":"https://avatars0.githubusercontent.com/u/4950209?v=4","gravatar_id":"","url":"https://api.github.com/users/maxime1992","html_url":"https://github.com/maxime1992","followers_url":"https://api.github.com/users/maxime1992/followers","following_url":"https://api.github.com/users/maxime1992/following{/other_user}","gists_url":"https://api.github.com/users/maxime1992/gists{/gist_id}","starred_url":"https://api.github.com/users/maxime1992/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/maxime1992/subscriptions","organizations_url":"https://api.github.com/users/maxime1992/orgs","repos_url":"https://api.github.com/users/maxime1992/repos","events_url":"https://api.github.com/users/maxime1992/events{/privacy}","received_events_url":"https://api.github.com/users/maxime1992/received_events","type":"User","site_admin":false},"assignees":[{"login":"maxime1992","id":4950209,"node_id":"MDQ6VXNlcjQ5NTAyMDk=","avatar_url":"https://avatars0.githubusercontent.com/u/4950209?v=4","gravatar_id":"","url":"https://api.github.com/users/maxime1992","html_url":"https://github.com/maxime1992","followers_url":"https://api.github.com/users/maxime1992/followers","following_url":"https://api.github.com/users/maxime1992/following{/other_user}","gists_url":"https://api.github.com/users/maxime1992/gists{/gist_id}","starred_url":"https://api.github.com/users/maxime1992/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/maxime1992/subscriptions","organizations_url":"https://api.github.com/users/maxime1992/orgs","repos_url":"https://api.github.com/users/maxime1992/repos","events_url":"https://api.github.com/users/maxime1992/events{/privacy}","received_events_url":"https://api.github.com/users/maxime1992/received_events","type":"User","site_admin":false}],"milestone":null,"comments":1,"created_at":"2019-08-20T11:39:01Z","updated_at":"2019-09-04T08:50:01Z","closed_at":null,"author_association":"COLLABORATOR","body":"When dealing with polymorphic data and using the remap functions it'd be nice to have a `oneOf` validator. It'd take as argument keys of the `formGroup` so it'd also be type safe.\r\n\r\nExample here https://github.com/cloudnc/ngx-sub-form/blob/6ecdb2017e/src/app/main/listing/listing-form/vehicle-listing/vehicle-product.component.ts#L24-L25\r\n\r\nAnd it could look like the following:\r\n\r\n```ts\r\npublic getFormGroupControlOptions(): FormGroupOptions<YourPolymorphicForm> {\r\n  return {\r\n    validators: [NgxSubFormValidators.OneOf('prop1', 'prop2', 'prop3')],\r\n  };\r\n}\r\n```"},"comment":{"url":"https://api.github.com/repos/cloudnc/ngx-sub-form/issues/comments/527807029","html_url":"https://github.com/cloudnc/ngx-sub-form/issues/91#issuecomment-527807029","issue_url":"https://api.github.com/repos/cloudnc/ngx-sub-form/issues/91","id":527807029,"node_id":"MDEyOklzc3VlQ29tbWVudDUyNzgwNzAyOQ==","user":{"login":"maxime1992","id":4950209,"node_id":"MDQ6VXNlcjQ5NTAyMDk=","avatar_url":"https://avatars0.githubusercontent.com/u/4950209?v=4","gravatar_id":"","url":"https://api.github.com/users/maxime1992","html_url":"https://github.com/maxime1992","followers_url":"https://api.github.com/users/maxime1992/followers","following_url":"https://api.github.com/users/maxime1992/following{/other_user}","gists_url":"https://api.github.com/users/maxime1992/gists{/gist_id}","starred_url":"https://api.github.com/users/maxime1992/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/maxime1992/subscriptions","organizations_url":"https://api.github.com/users/maxime1992/orgs","repos_url":"https://api.github.com/users/maxime1992/repos","events_url":"https://api.github.com/users/maxime1992/events{/privacy}","received_events_url":"https://api.github.com/users/maxime1992/received_events","type":"User","site_admin":false},"created_at":"2019-09-04T08:50:01Z","updated_at":"2019-09-04T08:50:01Z","author_association":"COLLABORATOR","body":"The validator wouldn't be aware whether you implement the 3 sub forms in the same component or if you break them down. The validator would be here only to guarantee that the form would be in valid state **if** exactly 1 value of the 3 possible ones is defined."}}
other: {"actor":{"display_login":"maxime1992"}}