// Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. 'use strict'; var msrest = require('ms-rest'), msrestazure = require('ms-rest-azure'), ResourceManagementClient = require('azure-arm-resource').ResourceManagementClient, log = require('./lib/util/logging'), utils = require('./lib/util/utils'), Constants = require('./lib/util/constants'), path = require('path'), util = require('util'), SpecValidator = require('./lib/specValidator'); exports.finalValidationResult = { validityStatus: true }; exports.getDocumentsFromCompositeSwagger = function getDocumentsFromCompositeSwagger(compositeSpecPath) { let compositeSwagger; let finalDocs = []; return utils.parseJson(compositeSpecPath).then(function (result) { compositeSwagger = result; if (!(compositeSwagger.documents && Array.isArray(compositeSwagger.documents) && compositeSwagger.documents.length > 0)) { throw new Error(`CompositeSwagger - ${compositeSpecPath} must contain a documents property and it must be of type array and it must be a non empty array.`); } let docs = compositeSwagger.documents; let basePath = path.dirname(compositeSpecPath); for (let i=0; i