title: Rails 5. Strong params require not used if one permit key is set
body: <p>I am using Rails 5 to create a JSON Api.</p>
  
  <p>My controller uses strong parameters with one <strong>require</strong> attribute like this:</p>
  
  <pre><code>params.require(:require_attribute).permit(:permit_attribute1,:permit_attribute2)
  </code></pre>
  
  <p>Normally I have to send my JSON like this: </p>
  
  <pre><code>{
      "require_attribute":{
          "permit_attribute1": "data",
          "permit_attribute2": "data"
      }
  }
  </code></pre>
  
  <p>And if the required attribute is missing,I have to get this message:</p>
  
  <pre><code>"ActionController::ParameterMissing: param is missing or the value is empty: require_attribute"
  </code></pre>
  
  <p>My problem is, if I remove the required attribute from JSON and I have one <code>permit</code> attribute in common with strong params it does work.</p>
  
  <p>The JSON I send :</p>
  
  <pre><code>{
      "permit_attribute1": "data",
  }
  </code></pre>
  
  <p>When I get <em>params</em> in <code>log</code> I have:</p>
  
  <blockquote>
    <p>{"permit1"=>data, "controller"=>"mycontroller", "action"=>"create", <strong>"require_attribute"=>{"permit1"=>1}</strong>}</p>
  </blockquote>
  
  <p>It seems Rails creates a hash with required key instead of raising an error.
  But I want to force the required attribute when I receive a JSON.</p>
  
  <p>Anyone have an idea?</p>