thiagobustamante / typescript-rest-swagger

Swagger tools for typescript-rest
156 stars 57 forks source link

[validation] Invalid path for the entry file should be validated upon generation #117

Open joshuadeguzman opened 4 years ago

joshuadeguzman commented 4 years ago

Problem

Upon running swaggerGen -c ./swaggerConfig.json, invalid directories are not properly validated.

swaggerConfig.json

{
    "entryFile": "test/apis.ts" <- Invalid directory
}

Prerequisites

Steps to replicate

  1. Prepare swaggerConfig.json

swaggerConfig.json

{
    "swagger": {
        "outputDirectory": "./dist",
        "entryFile": "test/apis.ts" <- Invalid directory
    }
}
  1. Run the command swaggerGen -c ./swaggerConfig.json

Expected output

$ <Some invalid message here.

Actual output

$ Generation completed.

Although this is trivial for now since it can be checked properly during dev, this might be a problem for some tasks such as creating the files dynamically or automating a pipieline.