swagger-typescript-generator
Version:
Generate typescript code from swagger.json. Before start this project I try use [swagger-typescript-codegen](https://github.com/mtennoe/swagger-typescript-codegen) based on [mustache templates](https://github.com/mtennoe/swagger-js-codegen/tree/master/lib
45 lines • 1.71 kB
JavaScript
;
var __extends = (this && this.__extends) || (function () {
var extendStatics = function (d, b) {
extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
return extendStatics(d, b);
};
return function (d, b) {
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
Object.defineProperty(exports, "__esModule", { value: true });
exports.SwaggerPath = void 0;
var swagger_base_1 = require("./swagger-base");
var SwaggerPath = /** @class */ (function (_super) {
__extends(SwaggerPath, _super);
function SwaggerPath(parent, key, source) {
var _this = _super.call(this) || this;
_this.name = '';
_this.tags = [];
_this.httpMethods = [];
_this.parent = parent;
_this.source = source;
_this.name = _this.utils.getPathName(_this, key);
_this.url = key;
Object.keys(source).forEach(function (key) {
var el = source[key];
_this.httpMethods.push(key);
_this.tags.push(el.tags);
});
_this.tags = uniqueItems(_this.tags.flat(), function (it) { return it; });
return _this;
}
SwaggerPath.prototype.init = function () {
};
return SwaggerPath;
}(swagger_base_1.SwaggerBase));
exports.SwaggerPath = SwaggerPath;
function uniqueItems(arg0, arg1) {
throw new Error('Function not implemented.');
}
//# sourceMappingURL=swagger-path.js.map