title: Custom, content based validator for Alamofire (in Swift)
body: <p>I know you can add a status code and content type validators, but I'd really love to be able to write my own validator based on the result content - basically I want to make sure the json I'm getting back contains some fields, and that their value is valid.  </p>
  
  <p>The way the app I'm working on is currently designed is there's a Server class that handles all the api calls, and the response object is returned to whoever called it, so they can do their logic / update ui, etc.  </p>
  
  <p>Now I have a status code validator on all the requests, so I don't need to have it on all external, but I have several apis, that require that custom validation logic, which means I have to add it in all the places that call it, AND that I can't use this amazing syntax:</p>
  
  <pre><code>switch resp.result {
      case .Success(let value):
          print("yay")
      case .Failure:
          print("nay")
  }
  </code></pre>
  
  <hr>
  
  <p>I'd love any answer/pointer that can help me find a solution,<br>
  Thank you all so much in advance! :)</p>