Skip to content

Syntax error in generated JS client #2022

@delenius

Description

@delenius

I am using swagger-codegen from master, just cloned.
I am getting the following at the top of my ApiClient.js

(function(root, factory) {
  if (typeof define === 'function' && define.amd) {
    // AMD. Register as an anonymous module.
    define(['superagent'], factory);
  } else if (typeof module === 'object' && module.exports) {
    // CommonJS-like environments that support module.exports, like Node.
    module.exports = factory(require('superagent'));
  } else {
    // Browser globals (root is window)
    if (!root.) {
      root. = {};
    }
    root..ApiClient = factory(root.superagent);
  }

Notice the root. and root... This causes node to choke.
My swagger.yaml file is automatically generated from my Java server, so it should be fine.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions