ng-swagger-gen.js
function operationId(given, method, url, allKnown) {
  var id;
  var generate = given == null;
  if (generate) {
    id = toIdentifier(method + url);
  } else {
    id = toIdentifier(given);
  }
  var duplicated = allKnown.has(id);
  if (duplicated) {
    var i = 1;
    while (allKnown.has(id + '_' + i)) {
      i++;
    }
    id = id + '_' + i;
  }
  if (generate) {
    console.warn(
      "Operation '" +
        method +
        "' on '" +
        url +
        "' defines no operationId. Assuming '" +
        id +
        "'."
    );
  } else if (duplicated) {
    console.warn(
      "Operation '" +
        method +
        "' on '" +
        url +
        "' defines a duplicated operationId: " +
        given +
        '. ' +
        "Assuming '" +
        id +
        "'."
    );
  }
  allKnown.add(id);
  return id;
}
function operationId(given, method, url, allKnown) {
  var id;
  var generate = given == null;
  if (generate) {
    id = toIdentifier(method + url);
  } else {
    id = toIdentifier(given);
  }
  var duplicated = allKnown.has(id);
  if (duplicated) {
    var i = 1;
    while (allKnown.has(id + '_' + i)) {
      i++;
    }
    id = id + '_' + i;
  }
  if (generate) {
    console.warn(
      "Operation '" +
        method +
        "' on '" +
        url +
        "' defines no operationId. Assuming '" +
        id +
        "'."
    );
  } else if (duplicated) {
    console.warn(
      "Operation '" +
        method +
        "' on '" +
        url +
        "' defines a duplicated operationId: " +
        given +
        '. ' +
        "Assuming '" +
        id +
        "'."
    );
  }
  allKnown.add(id);
  return id;
}
function operationId ( given , method , url , allKnown ) { var id ; var generate = given == null ; if ( generate ) { id = toIdentifier ( method + url ) ; } else { id = toIdentifier ( given ) ; } var duplicated = allKnown . has ( id ) ; if ( duplicated ) { var i = 1 ; while ( allKnown . has ( id + '_' + i ) ) { i ++ ; } id = id + '_' + i ; } if ( generate ) { console . warn ( "Operation '" + method + "' on '" + url + "' defines no operationId. Assuming '" + id + "'." ) ; } else if ( duplicated ) { console . warn ( "Operation '" + method + "' on '" + url + "' defines a duplicated operationId: " + given + '. ' + "Assuming '" + id + "'." ) ; } allKnown . add ( id ) ; return id ; }
Returns the actual operation id, assuming the one given.
If none is given, generates one
Returns the actual operation id assuming the one given . If none is given generates one