小编mou*_*dat的帖子

在构建时生成 Swagger json

我正在开发一个 ASP.NET Core WebAPI 项目,我正在尝试找到一种在构建时生成 swagger json 的方法?

由于我正在使用 4 个环境,因此我希望有 4 个 swagger.json 具有我选择的不同名称,例如:

  • swagger_{appName} dev {buildNumber}.json
  • swagger_{appName}演示{buildNumber}.json
  • swagger_{appName} int {buildNumber}.json
  • swagger_{appName}暂存{buildNumber}.json

是否也可以编辑 json 中的字段?我想编辑(取决于环境)以下字段:主机、方案和基本路径。

我正在使用 Swashbuckle.AspNetCore,但它似乎没有选项来执行此类任务,还是我错了?

提前致谢

visual-studio swagger azure-devops asp.net-core asp.net-core-webapi

12
推荐指数
2
解决办法
2万
查看次数

Angular CLI:无法读取undefined的属性'write'

在升级了一些Angular软件包(从4到5)之后,一位同事遇到了以下问题:

Cannot read property 'write' of undefined
TypeError: Cannot read property 'write' of undefined
   at UI.write (C:\Workspace\MyAngularApp\MyAngularApp.Web\node_modules\@angular\cli\ember-cli\lib\ui\index.js:56:23)
   at UI.writeLine (C:\Workspace\MyAngularApp\MyAngularApp.Web\node_modules\@angular\cli\ember-cli\lib\ui\index.js:69:8)
   at Class.run (C:\Workspace\MyAngularApp\MyAngularApp.Web\node_modules\@angular\cli\tasks\serve.js:237:12)
   at check_port_1.checkPort.then.port (C:\Workspace\MyAngularApp\MyAngularApp.Web\node_modules\@angular\cli\commands\serve.js:123:26)
   at <anonymous>
   at process._tickCallback (internal/process/next_tick.js:188:7)
Run Code Online (Sandbox Code Playgroud)

这个问题是不可理解的,因为我没有这个问题,并且构建在VSTS中也是成功的:(

这是package.json(从4.3.6升级后):

    "dependencies": {
        "@angular-devkit/core": "0.6.8",
        "@angular/animations": "5.2.9",
        "@angular/common": "5.2.9",
        "@angular/compiler": "5.2.9",
        "@angular/core": "5.2.9",
        "@angular/forms": "5.2.9",
        "@angular/http": "5.2.9",
        "@angular/platform-browser": "5.2.9",
        "@angular/platform-browser-dynamic": "5.2.9",
        "@angular/router": "5.2.9",
        "@ngx-translate/core": "8.0.0",
        "@ngx-translate/http-loader": "1.0.2",
        "angular-azure-blob-service": "1.0.0",
        "angular-sortablejs": "2.0.6",
        "angular2-fontawesome": "5.2.1",
        "angular2-multiselect-dropdown": "2.4.0",
        "bootstrap": "4.1.1",
        "copy-webpack-plugin": "4.3.1",
        "core-js": "2.5.0",
        "font-awesome": "4.7.0",
        "jquery": "^3.3.1",
        "lightbox2": "2.10.0",
        "lodash": …
Run Code Online (Sandbox Code Playgroud)

angular

3
推荐指数
1
解决办法
4937
查看次数