title: How to add accept application/json header for swagger-php OpenApi
body: <p>I'm use <a href="https://github.com/DarkaOnLine/L5-Swagger" rel="noreferrer">L5-Swagger</a> 5.7.* package (wrapper of <a href="https://github.com/zircote/swagger-php" rel="noreferrer">Swagger-php</a>) and tried describe Laravel REST API. So, my code like this:</p>
  
  <pre><code>/**
   * @OA\Post(path="/subscribers",
   *     @OA\RequestBody(
   *         @OA\MediaType(
   *            mediaType="application/json",
   *            @OA\Schema(
   *               type="object",
   *               @OA\Property(property="email", type="string")
   *            )
   *        )
   *    ),
   *   @OA\Response(response=201,description="Successful created"),
   *   @OA\Response(response=422, description="Error: Unprocessable Entity")
   * )
   */
  public function publicStore(SaveSubscriber $request)
  {
      $subscriber = Subscriber::create($request-&gt;all());
      return new SubscriberResource($subscriber);
  }
  </code></pre>
  
  <p>But when I try send request via swagger panel I get code:</p>
  
  <pre><code>curl -X POST "https://examile.com/api/subscribers" -H "accept: */*" -H "Content-Type: application/json" -H "X-CSRF-TOKEN: " -d "{\"email\":\"bademail\"}"
  </code></pre>
  
  <p>As you can see, accept is not application/json and Laravel doesn't identify this as an AJAX request. So, when I send wrong data and expect to get 422 with errors in real I get 200 code with errors in "session". Request (XHR) through the swagger panel is also processed incorrectly, CURL code just for clarity.</p>
  
  <p>Also, I found that in the previous version was used something like:</p>
  
  <pre><code>* @SWG\Post(
  *     ...
  *     consumes={"multipart/form-data"},
  *     produces={"text/plain, application/json"},
  *     ...)
  </code></pre>
  
  <p>But now it's already out of date.</p>
  
  <p>So, how get 422 code without redirect if validation fails? Or maybe add 'XMLHttpRequest' header? What is the best thing to do here?</p>