I\'m trying to break my API document up into multiple JSON files that can be edited independently. All the examples I\'ve been able to find use the Swagger 1.2 schema which
If JSON ref's didn't work for you, it might be useful to write your own concatenator. Well, instead of writing your own you can actually use something that is already out there. Any templating engine will do. In my case Handlebars turned out to be very helpful (because Handlebars actually preserves indentation, which is perfect for Yaml files since they are case sensitive).
Then you can have a build script in Node:
'use strict';
var hbs = require('handlebars');
var fs  = require('fs');
var dir = __dirname + '/your_api_dir';
var files = fs.readdirSync(dir);
files.forEach((fileName) => {
  var raw = fs.readFileSync(dir + '/' + fileName, 'utf8');
  hbs.registerPartial(file, raw);
});
var index = fs.readFileSync(dir + '/index.yaml');
var out = hbs.compile(index.toString());
Read more regarding the issue on my blog.