Proceeds with the generation given the parsed swagger object
188912
function doGenerate(swagger, options) {
  if (!options.templates) {
    options.templates = path.join(__dirname, 'templates');
  }

  var output = path.normalize(options.output || 'src/app/api');
  var prefix = options.prefix || 'Api';

  if (swagger.swagger !== '2.0') {
    console.error(
      'Invalid swagger specification. Must be a 2.0. Currently ' +
        swagger.swagger
    );
    process.exit(1);
  }
  swagger.paths = swagger.paths || {};
  swagger.models = swagger.models || [];
  var models = processModels(swagger, options);
  var services = processServices(swagger, models, options);

  // Apply the tag filter. If includeTags is null, uses all services,
  // but still can remove unused models
  const includeTags = options.includeTags;
  if (typeof includeTags == 'string') {
    options.includeTags = includeTags.split(',');
  }
  const excludeTags = options.excludeTags;
  if (typeof excludeTags == 'string') {
    options.excludeTags = excludeTags.split(',');
  }
  applyTagFilter(models, services, options);

  // Read the templates
  var templates = {};
  var files = fs.readdirSync(options.templates);
  files.forEach(function(file, index) {
    var pos = file.indexOf('.mustache');
    if (pos >= 0) {
      var fullFile = path.join(options.templates, file);
      templates[file.substr(0, pos)] = fs.readFileSync(fullFile, 'utf-8');
    }
  });

  // Prepare the output folder
  const modelsOutput = path.join(output, 'models');
  const servicesOutput = path.join(output, 'services');
  mkdirs(modelsOutput);
  mkdirs(servicesOutput);

  var removeStaleFiles = options.removeStaleFiles !== false;
  var generateEnumModule = options.enumModule !== false;

  // Utility function to render a template and write it to a file
  var generate = function(template, model, file) {
    var code = Mustache.render(template, model, templates)
      .replace(/[^\S\r\n]+$/gm, '');
    fs.writeFileSync(file, code, 'UTF-8');
    console.info('Wrote ' + file);
  };

  // Calculate the globally used names
  var moduleClass = toClassName(prefix + 'Module');
  var moduleFile = toFileName(moduleClass);
  // Angular's best practices demands xxx.module.ts, not xxx-module.ts
  moduleFile = moduleFile.replace(/\-module$/, '.module');
  var configurationClass = toClassName(prefix + 'Configuration');
  var configurationInterface = toClassName(prefix + 'ConfigurationInterface');
  var configurationFile = toFileName(configurationClass);

  function applyGlobals(to) {
    to.prefix = prefix;
    to.moduleClass = moduleClass;
    to.moduleFile = moduleFile;
    to.configurationClass = configurationClass;
    to.configurationInterface = configurationInterface;
    to.configurationFile = configurationFile;
    return to;
  }

  // Write the models and examples
  var modelsArray = [];
  for (var modelName in models) {
    var model = models[modelName];
    if (model.modelIsEnum) {
      model.enumModule = generateEnumModule;
    }
    applyGlobals(model);

    // When the model name differs from the class name, it will be duplicated
    // in the array. For example the-user would be TheUser, and would be twice.
    if (modelsArray.includes(model)) {
      continue;
    }
    modelsArray.push(model);
    generate(
      templates.model,
      model,
      path.join(modelsOutput, model.modelFile + '.ts')
    );
    if (options.generateExamples && model.modelExample) {
      var example = JSON.stringify(model.modelExample, null, 2);
      example = example.replace(/'/g, "\\'");
      example = example.replace(/"/g, "'");
      example = example.replace(/\n/g, "\n  ");
      model.modelExampleStr = example;
      generate(
        templates.example,
        model,
        path.join(modelsOutput, model.modelExampleFile + '.ts')
      );
    }
  }
  if (modelsArray.length > 0) {
    modelsArray[modelsArray.length - 1].modelIsLast = true;
  }
  if (removeStaleFiles) {
    var modelFiles = fs.readdirSync(modelsOutput);
    modelFiles.forEach((file, index) => {
      var ok = false;
      var basename = path.basename(file);
      for (var modelName in models) {
        var model = models[modelName];
        if (basename == model.modelFile + '.ts'
          || basename == model.modelExampleFile + '.ts'
            && model.modelExampleStr != null) {
          ok = true;
          break;
        }
      }
      if (!ok) {
        rmIfExists(path.join(modelsOutput, file));
      }
    });
  }

  // Write the model index
  var modelIndexFile = path.join(output, 'models.ts');
  if (options.modelIndex !== false) {
    generate(templates.models, { models: modelsArray }, modelIndexFile);
  } else if (removeStaleFiles) {
    rmIfExists(modelIndexFile);
  }

  // Write the StrictHttpResponse type
  generate(templates.strictHttpResponse, {},
    path.join(output, 'strict-http-response.ts'));

  // Write the services
  var servicesArray = [];
  for (var serviceName in services) {
    var service = services[serviceName];
    service.generalErrorHandler = options.errorHandler !== false;
    applyGlobals(service);
    servicesArray.push(service);

    generate(
      templates.service,
      service,
      path.join(servicesOutput, service.serviceFile + '.ts')
    );
  }
  if (servicesArray.length > 0) {
    servicesArray[servicesArray.length - 1].serviceIsLast = true;
  }
  if (removeStaleFiles) {
    var serviceFiles = fs.readdirSync(servicesOutput);
    serviceFiles.forEach((file, index) => {
      var ok = false;
      var basename = path.basename(file);
      for (var serviceName in services) {
        var service = services[serviceName];
        if (basename == service.serviceFile + '.ts') {
          ok = true;
          break;
        }
      }
      if (!ok) {
        rmIfExists(path.join(servicesOutput, file));
      }
    });
  }

  // Write the service index
  var serviceIndexFile = path.join(output, 'services.ts');
  if (options.serviceIndex !== false) {
    generate(templates.services, { services: servicesArray }, serviceIndexFile);
  } else if (removeStaleFiles) {
    rmIfExists(serviceIndexFile);
  }

  // Write the module
  var fullModuleFile = path.join(output, moduleFile + '.ts');
  if (options.apiModule !== false) {
    generate(templates.module, applyGlobals({
        services: servicesArray
      }),
      fullModuleFile);
  } else if (removeStaleFiles) {
    rmIfExists(fullModuleFile);
  }

  // Write the configuration
  {
    var rootUrl = '';
    if (swagger.hasOwnProperty('host') && swagger.host !== '') {
      var schemes = swagger.schemes || [];
      var scheme = schemes.length === 0 ? '//' : schemes[0] + '://';
      rootUrl = scheme + swagger.host;
    }
    if (swagger.hasOwnProperty('basePath') && swagger.basePath !== ''
      && swagger.basePath !== '/') {
      rootUrl += swagger.basePath;
    }

    generate(templates.configuration, applyGlobals({
        rootUrl: rootUrl,
      }),
      path.join(output, configurationFile + '.ts')
    );
  }

  // Write the BaseService
  {
    generate(templates.baseService, applyGlobals({}),
      path.join(output, 'base-service.ts'));
  }
}
722462
function (response) {

          var i, j, swagger = response.obj;

          if(swagger === null || Object.keys(swagger).length === 0) {
            try {
              swagger = JSON.parse(response.data);
            }
            catch (e){
              swagger = {};
            }
          }

          processedCalls += 1;

          for (i = 0; i < opt.length; i++) {
            var path = opt[i];
            if(path == null) {
              resolvedRefs[name] = {
                name: name,
                obj: swagger
              };
            }
            else {
              var location = swagger, parts = path.split('/');
              for (j = 0; j < parts.length; j++) {
                var segment = parts[j];
                if(segment.indexOf('~1') !== -1) {
                  segment = parts[j].replace(/~0/g, '~').replace(/~1/g, '/');
                  if(segment.charAt(0) !== '/') {
                    segment = '/' + segment;
                  }
                }

                if (typeof location === 'undefined') {
                  break;
                }

                if (segment.length > 0) {
                  location = location[segment];
                }
              }
              var resolved = host + '#' + path, resolvedName = parts[j-1];

              if (typeof location !== 'undefined') {
                resolvedRefs[resolved] = {
                  name: resolvedName,
                  obj: location
                };
              } else {
                unresolvedRefs[resolved] = null;
              }
            }
          }
          if (processedCalls === expectedCalls) {
            self.finish(spec, resolutionTable, resolvedRefs, unresolvedRefs, callback);
          }
        }
568116
def swagger_object(target_class, request, options)
      object = {
        info: info_object(options[:info].merge(version: options[:doc_version])),
        swagger: '2.0',
        produces: content_types_for(target_class),
        authorizations: options[:authorizations],
        securityDefinitions: options[:security_definitions],
        security: options[:security],
        host: GrapeSwagger::DocMethods::OptionalObject.build(:host, options, request),
        basePath: GrapeSwagger::DocMethods::OptionalObject.build(:base_path, options, request),
        schemes: options[:schemes].is_a?(String) ? [options[:schemes]] : options[:schemes]
      }

      GrapeSwagger::DocMethods::Extensions.add_extensions_to_root(options, object)
      object.delete_if { |_, value| value.blank? }
    end
1318088
function generator(app, base) {
  if (!utils.isValid(app, 'verb-readme-generator')) return;
  app.cwd = process.cwd();

  /**
   * Listeners
   */

  app.on('view', view => {
    view.extname = view.extname || '.md';
  });

  /**
   * Init options
   */

  options(app);
  app.option(app.pkg.get('verb') || {});

  /**
   * Plugins
   */

  app.use(require('verb-defaults'));
  app.use(require('verb-collections'));
  app.use(require('verb-repo-helpers'));
  app.use(require('verb-repo-data'));
  app.use(require('verb-toc'));

  /**
   * Engine
   */

  app.engine('hbs', require('engine-handlebars'));
  app.engine('md', app.getEngine('.*'));

  /**
   * Helpers
   */

  helpers(app);
  setup.options(app);
  setup.data(app);

  /**
   * Alias for the [readme]() task, generates a README.md to the user's working directory.
   *
   * ```sh
   * $ verb readme
   * ```
   * @name default
   * @api public
   */

  app.task('default', ['verbmd-prompt', 'readme']);

  /**
   * Generate `README.md` and fix missing [reflinks](#reflinks).
   *
   * ```sh
   * $ verb readme
   * ```
   * @name readme
   * @api public
   */

  app.task('readme', [
    'readme-middleware',
    'readme-templates',
    'readme-data',
    'readme-render',
    'readme-reflinks'
  ]);

  /**
   * Generate a README.md from a `.verb.md` template. Runs the [setup](), and [verbmd]() tasks.
   * This is a [verb][docs]{tasks.md#silent} task.
   *
   * ```sh
   * $ verb readme:readme-render
   * ```
   * @name readme-render
   */

  app.task('readme-render', {silent: true}, function() {
    debug(`starting task: ${this.name}`, __filename);
    const srcBase = app.options.srcBase || app.cwd;
    const file = app.options.readme || '.verb.md';

    app.data('pkg', require(path.join(process.cwd(), 'package.json')));
    app.data('author.linkedin', app.data('author.linkedin') || 'jonschlinkert');
    app.data('author.twitter', app.data('author.twitter') || 'jonschlinkert');

    return app.src(file, {cwd: srcBase})
      .pipe(through.obj((file, enc, next) => {
        let print = app.options.pp;
        if (print) {
          let str = `{%= print(${print}) %}\n` + file.contents.toString();
          file.contents = Buffer.from(str);
        }
        next(null, file);
      }))
      .pipe(app.renderFile('*'))
      .pipe(gfm.replace())
      .pipe(utils.handle.once(app, 'prePipeline'))
      .pipe(utils.reflinks(app.options))
      .pipe(app.pipeline(app.options.pipeline))
      .pipe(gfm.restore())
      .pipe(app.dest(file => {
        app.base.emit('dest', file);
        file.basename = 'README.md';
        return app.cwd;
      }));
  });

  /**
   * Initialize middleware used for rendering the [readme](#readme).
   *
   * ```sh
   * $ verb readme:readme-middleware
   * ```
   * @name readme-middleware
   */

  app.task('readme-middleware', { silent: true }, cb => {
    app.handler('prePipeline');
    app.preRender(/(verb|readme)\.md$/i, (file, next) => {
      utils.del(path.resolve(app.cwd, 'readme.md'), next);
    });
    app.preWrite(/\.md$/, (file, next) => {
      app.union('cache.reflinks', file._reflinks);
      placements(app, file, err => {
        if (err) {
          next(err);
          return;
        }
        sections(app, file, next);
      });
    });
    cb();
  });

  /**
   * Loads data to used for rendering templates. Called by the [readme]() task.
   *
   * ```sh
   * $ verb readme:readme-data
   * ```
   * @name readme-data
   */

  app.task('readme-data', { silent: true }, cb => {
    app.data({bower: fs.existsSync(path.join(app.cwd, 'bower.json'))});
    cb();
  });

  /**
   * Load layouts, includes and badges commonly used for generating a README.md.
   *
   * ```sh
   * $ verb readme:readme-templates
   * ```
   * @name readme-templates
   */

  app.task('readme-templates', { silent: true }, cb => {
    let templates = path.resolve.bind(path, __dirname, 'templates');
    let config = app.base.get('cache.config') || {};

    // load default docs
    app.docs('*.md', {cwd: templates('docs')});

    // load `layout` templates
    app.layouts('*.md', { cwd: templates('layouts') });
    app.includes('**/*.md', { cwd: templates('includes') });
    app.includes(require('./templates/includes'));
    app.badges(require('./templates/badges'));

    // load `docs` templates from user `./docs` or specified dir
    let docs = path.resolve(app.cwd, 'docs');
    if (fs.existsSync(docs) && app.pkg.get('verb.options.docs') !== false) {
      app.docs('**/*.md', { cwd: docs });
    }

    // call `.config.process` again to override built-in templates
    // with any templates defined in `package.json`
    if (typeof config.views !== 'undefined') {
      app.config.process({views: config.views}, cb);
    } else {
      cb();
    }
  });

  /**
   * Run after other tasks to get any missing reflinks found in rendered markdown
   * documents, and add them to the `verb.reflinks` array in package.json. Verb
   * uses this array to generate reflinks so that missing reflinks will still resolve.
   *
   * ```sh
   * $ verb readme:readme-reflinks
   * ```
   * @name readme-reflinks
   */

  app.task('readme-reflinks', {silent: true}, cb => {
    let existing = app.pkg.get('verb.reflinks') || [];
    let reflinks = app.get('cache.reflinks') || [];
    let diff = utils.diff(reflinks, existing);
    if (diff.length > 1) {
      app.pkg.union('verb.reflinks', diff);
      app.pkg.save();
      app.pkg.logInfo('updated package.json with:', {reflinks: diff});
    }
    cb();
  });

  /**
   * Generate a new `.verb.md` template to the current working directory. This task is
   * also aliased as `verbmd-new` to provide a semantic task name when this generator is
   * used as a plugin.
   *
   * ```sh
   * $ verb readme:new
   * # or
   * $ verb readme:verbmd-new
   * ```
   * @name new
   */

  app.task('new', ['verbmd-new']);
  app.task('verbmd-new', function() {
    debug(`starting task: ${this.name}`, __filename);
    let cwd = app.options.srcBase || path.join(__dirname, 'templates/verbmd');
    return app.src('basic.md', { cwd })
      .pipe(app.conflicts(app.cwd))
      .pipe(app.dest(app.cwd));
  });

  /**
   * Prompts the user to add a new `.verb.md` template to the current working directory.
   * Useful in sub-generators.
   *
   * ```sh
   * $ verb readme:verbmd-prompt
   * # alias aliased as
   * $ verb readme:ask
   * ```
   * @name verbmd-prompt
   */

  app.task('verbmd-prompt', {silent: true}, function(cb) {
    if (fs.existsSync('.verb.md')) return cb();
    app.confirm('verbmd', 'Can\'t find a .verb.md, want to add one?');
    app.ask('verbmd', { save: false }, function(err, answers) {
      if (err) return cb(err);
      if (answers.verbmd) {
        app.build('new', cb);
      } else {
        cb();
      }
    });
  });

  return generator;
}
1123212
function generate(initialStateOrOptions, condition, iterate, resultSelectorOrObservable, scheduler) {
    var resultSelector;
    var initialState;
    if (arguments.length == 1) {
        var options = initialStateOrOptions;
        initialState = options.initialState;
        condition = options.condition;
        iterate = options.iterate;
        resultSelector = options.resultSelector || _util_identity__WEBPACK_IMPORTED_MODULE_1__["identity"];
        scheduler = options.scheduler;
    }
    else if (resultSelectorOrObservable === undefined || Object(_util_isScheduler__WEBPACK_IMPORTED_MODULE_2__["isScheduler"])(resultSelectorOrObservable)) {
        initialState = initialStateOrOptions;
        resultSelector = _util_identity__WEBPACK_IMPORTED_MODULE_1__["identity"];
        scheduler = resultSelectorOrObservable;
    }
    else {
        initialState = initialStateOrOptions;
        resultSelector = resultSelectorOrObservable;
    }
    return new _Observable__WEBPACK_IMPORTED_MODULE_0__["Observable"](function (subscriber) {
        var state = initialState;
        if (scheduler) {
            return scheduler.schedule(dispatch, 0, {
                subscriber: subscriber,
                iterate: iterate,
                condition: condition,
                resultSelector: resultSelector,
                state: state
            });
        }
        do {
            if (condition) {
                var conditionResult = void 0;
                try {
                    conditionResult = condition(state);
                }
                catch (err) {
                    subscriber.error(err);
                    return undefined;
                }
                if (!conditionResult) {
                    subscriber.complete();
                    break;
                }
            }
            var value = void 0;
            try {
                value = resultSelector(state);
            }
            catch (err) {
                subscriber.error(err);
                return undefined;
            }
            subscriber.next(value);
            if (subscriber.closed) {
                break;
            }
            try {
                state = iterate(state);
            }
            catch (err) {
                subscriber.error(err);
                return undefined;
            }
        } while (true);
        return undefined;
    });
}
1137753
public final void generate()
            throws Exception
    {
        VelocityContext context = createAndPopulateContext();

        Writer writer = WriterFactory.newWriter( config.getOutputFile(), config.getEncoding() );

        try
        {
            velocityTemplate.merge( context, writer );
            writer.flush();
        }
        catch ( Exception e )
        {
            throw new Exception(
                    "Could not generate the template " + velocityTemplate.getName() + ": " + e.getMessage(), e );
        }
        finally
        {
            writer.close();
        }

    }
492769
function runUntilResolved(genInstance, nextArg) {
  try {
    let nextResult = genInstance.next(nextArg);
    if (nextResult.done) {
      return Promise.resolve(nextResult.value);
    } else {
      let v = nextResult.value;
      let fn = v.fn;
      let thisArg;
      if (fn instanceof Array) {
        thisArg = fn[0];
        fn = fn[1];
      }
      let args = v.args;

      if (fn == null || args == null) {
        throw new Error('`Episode7.run` requires using `Episode7.call` with every `yield`. '+
          'Check all of the `yield` expressions in [Function: '+genInstance.episode7Name+']');
      }

      // Iterate through the generator, handling
      // promises & nested generators.
      // Side-effect function is called without `this`.
      let sideEffect;
      if (isGeneratorFunction(fn)) {
        sideEffect = Promise.resolve()
          .then(function() {
            // Wrapped in `then` to promisify return value
            return run(fn, ...args)
          })
      } else {
        sideEffect = Promise.resolve()
          .then(function() {
            // Wrapped in `then` to promisify return value
            return fn.call(thisArg, ...args)
          })
      }
      return sideEffect
        .then(function(result) {
          return runUntilResolved(genInstance, result);
        })
    }

  } catch(error) {
    return Promise.reject(error);
  }
}
661963
def get_swagger_operation(self, context=default_context):
        
        consumes = produces = context.contenttype_serializers.keys()
        parameters = get_swagger_parameters(self.parameters, context)
        responses = {
            "400": Response(
                {
                    "description": "invalid input received",
                    "schema": Schema(
                        {
                            "title": "FailureObject",
                            "type": "object",
                            "properties": {
                                "success": {"type": "boolean"},
                                "result": {"type": "string"},
                            },
                            "required": ["success", "result"],
                        }
                    ),
                }
            )
        }

        for code, details in self.response_types.items():
            responses[str(code)] = details.swagger_definition(context)

        return Operation(
            {
                "summary": self.summary,
                "description": self.description,
                "consumes": consumes,
                "produces": produces,
                "parameters": parameters,
                "responses": responses,
                "operationId": self.raw_func.__name__,
                "tags": self.tags,
            }
        )
63043
public void generate(GeneratorOutput genOut) throws CodeGenerationException
    {
        //
        // Create a new VelocityContext
        //
        VelocityContext vc = new VelocityContext();

        //
        // Transfer any code generation properties excepted by the templates into the context
        // 
        HashMap<String,Object> genContext = genOut.getContext();
        for(String key : genContext.keySet())
            vc.put(key, genContext.get(key));

        try
        {
            Writer genWriter = genOut.getWriter();
            Template template = getTemplate(genOut.getTemplateName());
            template.merge(vc, genWriter);    
            genWriter.close();
        }
        // never wrap RuntimeException
        catch (RuntimeException re) {
            throw re;
        }
        catch (Exception e) {
            throw new CodeGenerationException(e);
        }
    }
1350859
function generateModelDefinition(schema, definitionName) {
    var definition = {
      required: [],
      properties: {}
    };
    mergePaths(definition, schema.paths, definitionName);
    mergePaths(definition, schema.virtuals, definitionName);
	
    //remove empty arrays -> swagger 2.0 validates 
    if (definition.required.length === 0) {
    	delete(definition.required);
    }
    if (definition.properties.length === 0) {
    	delete(definition.properties);
    }
    return definition;
  }
1059471
function processResponses(swagger, def, path, models) {
  var responses = def.responses || {};
  var operationResponses = {};
  operationResponses.returnHeaders = false;
  for (var code in responses) {
    var response = responses[code];
    if (response.$ref) {
      response = resolveRef(swagger, response.$ref);
    }
    if (!response.schema) {
      continue;
    }
    var type = propertyType(response.schema);
    if (/2\d\d/.test(code)) {
      // Successful response
      operationResponses.resultType = type;
      operationResponses.resultDescription = response.description;
      var headers = response.headers || {};
      for (var prop in headers) {
        // This operation returns at least one header
        operationResponses.returnHeaders = true;
        break;
      }
    }
    operationResponses[code] = {
      code: code,
      type: type,
    };
  }
  if (!operationResponses.resultType) {
    operationResponses.resultType = 'null';
  }
  return operationResponses;
}
1098469
public static Builder from(Reader swaggerReader) {
        Validate.notNull(swaggerReader, "swaggerReader must not be null");
        Swagger swagger;
        try {
            swagger = new SwaggerParser().parse(IOUtils.toString(swaggerReader));
        } catch (IOException e) {
            throw new RuntimeException("Swagger source can not be parsed", e);
        }
        if (swagger == null)
            throw new IllegalArgumentException("Swagger source is in a wrong format");

        return new Builder(swagger);
    }
301600
def call_on_each_endpoint(self, callback):
        

        if 'paths' not in self.swagger_dict:
            return

        for path, d in list(self.swagger_dict['paths'].items()):
            for method, op_spec in list(d.items()):
                data = EndpointData(path, method)

                # Which server method handles this endpoint?
                if 'x-bind-server' not in op_spec:
                    if 'x-no-bind-server' in op_spec:
                        # That route should not be auto-generated
                        log.info("Skipping generation of %s %s" % (method, path))
                        continue
                    else:
                        raise Exception("Swagger api defines no x-bind-server for %s %s" % (method, path))
                data.handler_server = op_spec['x-bind-server']

                # Make sure that endpoint only produces 'application/json'
                if 'produces' not in op_spec:
                    raise Exception("Swagger api has no 'produces' section for %s %s" % (method, path))
                if len(op_spec['produces']) != 1:
                    raise Exception("Expecting only one type under 'produces' for %s %s" % (method, path))
                if op_spec['produces'][0] == 'application/json':
                    data.produces_json = True
                elif op_spec['produces'][0] == 'text/html':
                    data.produces_html = True
                else:
                    raise Exception("Only 'application/json' or 'text/html' are supported. See %s %s" % (method, path))

                # Which client method handles this endpoint?
                if 'x-bind-client' in op_spec:
                    data.handler_client = op_spec['x-bind-client']

                # Should we decorate the server handler?
                if 'x-decorate-server' in op_spec:
                    data.decorate_server = op_spec['x-decorate-server']

                # Should we manipulate the requests parameters?
                if 'x-decorate-request' in op_spec:
                    data.decorate_request = op_spec['x-decorate-request']

                # Generate a bravado-core operation object
                data.operation = Operation.from_spec(self.spec, path, method, op_spec)

                # Figure out how parameters are passed: one json in body? one or
                # more values in query?
                if 'parameters' in op_spec:
                    params = op_spec['parameters']
                    for p in params:
                        if p['in'] == 'body':
                            data.param_in_body = True
                        if p['in'] == 'query':
                            data.param_in_query = True
                        if p['in'] == 'path':
                            data.param_in_path = True

                    if data.param_in_path:
                        # Substitute {...} with <...> in path, to make a Flask friendly path
                        data.path = data.path.replace('{', '<').replace('}', '>')

                    if data.param_in_body and data.param_in_query:
                        raise Exception("Cannot support params in both body and param (%s %s)" % (method, path))

                else:
                    data.no_params = True

                callback(data)
621361
function loadSpecification(defPath, data) {
  const resolvedPath = path.resolve(defPath);

  const extName = path.extname(resolvedPath);
  const loader = LOADERS[extName];

  // Check whether the definition file is actually a usable file
  if (loader === undefined) {
    throw new Error('Definition file should be .js, .json, .yml or .yaml');
  }

  const swaggerDefinition = loader(data, resolvedPath);
  return swaggerDefinition;
}
1295183
public function execute(): void
    {
        $this->generator->setNamespace($this->getNamespace());
        $this->parseWsdl();
        $this->generateStructures();
        $this->generateRequests();
        $this->generateResponses();
        $this->generateMethods();
        $this->generateService();
        $this->generateClient();
        $this->generateClassMap();
        ;
    }
7033
public function apiGenerate()
    {
        $paths = $this->getPaths();
        $this->stopOnFail(true);
        $this->info('Generating API documentation');
        $this->taskExec(sprintf('%s/sami', $paths['bin']))
            ->arg('update')
            ->arg(sprintf('%s/sami.php', $paths['build']))
            ->printOutput(true)
            ->run();
        $this->info('API documentation generated');
    }
1201813
public static Builder from(String swaggerString) {
        Validate.notEmpty(swaggerString, "swaggerString must not be null");
        return from(new StringReader(swaggerString));
    }