title: Converting a Swagger YAML file to JSON from the command line
body: <p>I'd like to convert a Swagger <code>YAML</code> file to <code>JSON</code> from the command line.  The plan is to use this command line during a CI job.  I've searched on google and found many solutions, but most of them use Python or Ruby, which I'd prefer not to use.  For example: <a href="http://www.commandlinefu.com/commands/view/12218/convert-yaml-to-json" rel="noreferrer">http://www.commandlinefu.com/commands/view/12218/convert-yaml-to-json</a></p>
  
  <p>I'd like to do this without using Python or Ruby, and
  I'd also like to be able to control the leading whitespace when formatting the JSON to match exactly the JSON that is output from Swagger's <a href="http://editor.swagger.io" rel="noreferrer">editor.swagger.io</a> editor, when you choose <code>File</code> -> <code>Download JSON</code></p>
  
  <p>All this means is that I'd like the whitespace padding to be four spaces, like so:</p>
  
  <pre><code>{
      "swagger": "2.0",
      "info": {
          "title": "API TITLE",
  </code></pre>
  
  <p>I haven't tried the Python method in the link above, but the Ruby method uses two space whitespace padding.  Perhaps there is a way to control that, but I don't want to use Ruby or Python in this solution anyway.</p>
  
  <p>I'm sure that there are many "correct" answers to this question.  I am looking for the solution that is most elegant with the least number of dependencies.  Ideally, a diff of the resulting JSON file against a JSON file generated by the <a href="http://editor.swagger.io" rel="noreferrer">editor.swagger.io</a> should be empty.</p>