I am trying to add the boolean attribute "novalidate" to all my forms.
I have tried numerous approaches in my theme_preprocess_form function but no luck. I see in some preprocess functions, $variables[‘attribute’] is an object and has methods like addClass() and setAttribute(). But in _preprocess_form it is an array. Plus setAttribute doesnt sound like it will do boolean attributes anyway.
I tried to simply override the twig template for a form and do this:
<form{{ attributes }} novalidate> {{ children }} </form>
but even that outputs:
<form novalidate="">