{"action":"created","issue":{"url":"https://api.github.com/repos/symfony/symfony/issues/18311","repository_url":"https://api.github.com/repos/symfony/symfony","labels_url":"https://api.github.com/repos/symfony/symfony/issues/18311/labels{/name}","comments_url":"https://api.github.com/repos/symfony/symfony/issues/18311/comments","events_url":"https://api.github.com/repos/symfony/symfony/issues/18311/events","html_url":"https://github.com/symfony/symfony/issues/18311","id":143513436,"number":18311,"title":"[Form] prototype \"required\" option is inconsistent with the default option","user":{"login":"sergeyfedotov","id":2290214,"avatar_url":"https://avatars.githubusercontent.com/u/2290214?v=3","gravatar_id":"","url":"https://api.github.com/users/sergeyfedotov","html_url":"https://github.com/sergeyfedotov","followers_url":"https://api.github.com/users/sergeyfedotov/followers","following_url":"https://api.github.com/users/sergeyfedotov/following{/other_user}","gists_url":"https://api.github.com/users/sergeyfedotov/gists{/gist_id}","starred_url":"https://api.github.com/users/sergeyfedotov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sergeyfedotov/subscriptions","organizations_url":"https://api.github.com/users/sergeyfedotov/orgs","repos_url":"https://api.github.com/users/sergeyfedotov/repos","events_url":"https://api.github.com/users/sergeyfedotov/events{/privacy}","received_events_url":"https://api.github.com/users/sergeyfedotov/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":6,"created_at":"2016-03-25T14:34:49Z","updated_at":"2016-03-25T18:13:27Z","closed_at":null,"body":"Seems like this issue is related to #15544\r\n\r\n```php\r\nclass PhotoType extends AbstractType\r\n{\r\n    public function buildForm(FormBuilderInterface $builder, array $options)\r\n    {\r\n        $builder->add('title', TextType::class);\r\n    }\r\n\r\n    public function configureOptions(OptionsResolver $resolver)\r\n    {\r\n        $resolver->setDefaults([\r\n            'data_class' => Photo::class,\r\n            'required' => false\r\n        ]);\r\n    }\r\n}\r\n```\r\n\r\nActual result:\r\n\r\n```html\r\n<input type=\"text\" id=\"news_photos___name___title\" name=\"news[photos][__name__][title]\" required=\"required\" class=\"form-control\" />\r\n```\r\n\r\nPrototype is rendered with the \"required\" option. The explanation of this behavior is given in the comment https://github.com/symfony/symfony/issues/15544#issuecomment-130710735\r\n\r\nIs it possible to fix it?\r\n"},"comment":{"url":"https://api.github.com/repos/symfony/symfony/issues/comments/201399999","html_url":"https://github.com/symfony/symfony/issues/18311#issuecomment-201399999","issue_url":"https://api.github.com/repos/symfony/symfony/issues/18311","id":201399999,"user":{"login":"HeahDude","id":10107633,"avatar_url":"https://avatars.githubusercontent.com/u/10107633?v=3","gravatar_id":"","url":"https://api.github.com/users/HeahDude","html_url":"https://github.com/HeahDude","followers_url":"https://api.github.com/users/HeahDude/followers","following_url":"https://api.github.com/users/HeahDude/following{/other_user}","gists_url":"https://api.github.com/users/HeahDude/gists{/gist_id}","starred_url":"https://api.github.com/users/HeahDude/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/HeahDude/subscriptions","organizations_url":"https://api.github.com/users/HeahDude/orgs","repos_url":"https://api.github.com/users/HeahDude/repos","events_url":"https://api.github.com/users/HeahDude/events{/privacy}","received_events_url":"https://api.github.com/users/HeahDude/received_events","type":"User","site_admin":false},"created_at":"2016-03-25T18:13:26Z","updated_at":"2016-03-25T18:13:26Z","body":">Child forms inherit the non-required option from the parent form unlike the prototype\r\n\r\nThis contradicts a tested behavior, see:\r\nhttps://github.com/symfony/symfony/blob/master/src/Symfony/Component/Form/Tests/Extension/Core/Type/CollectionTypeTest.php#L305\r\n\r\nIt should be expected that `required` default is overridden with the parent's default.\r\n\r\nSo what looks inconsistent to me is that it actually does not happen for the child forms but only for the prototype (the opposite of your suggestion)."}}