Skip to content

Latest commit

 

History

History
50 lines (40 loc) · 1.65 KB

Readme.md

File metadata and controls

50 lines (40 loc) · 1.65 KB

Clave.SwaggerCompare

Nuget Nuget Build Status

Installation

Run dotnet tool install --global Clave.SwaggerCompare

First time usage

Run swagger-compare in cmd. This will create a config.json example file in the folder you're running from. Then open the file and start editing.

Config file structure

{
  "Client1": {
    "Url": "", // Fully qualified URL. Serves as "base address".
    "Headers": {
      "Authorization": "Bearer AbCdEf123456" // Optionally specify any headers you would like to add to requests.
    }
  },
  "Client2": {
    "Url": "" // Fully qualified URL. Serves as "base address".
  },
  "TestRuns": [
    {
      "ExcludeEndpoints": [], // string[]. Endpoints that should not be called. Use asterisk for wildcard matching, f.ex. ["api/*/invoices", "*/health"]
      "TreatParametersAsRequired": [], // string[]. Often parameters are not *required* in the swagger definition, but in reality they are.
      "UrlParameterTestValues": {
        "param1": "value1"
      },
      "IncludeEndpoints": [
        {
          "Endpoint": "/time-slots",
          "Method": "POST",
          "DataFolder": "..\\test-data\\time-slot",
          "DisregardJsonResponseProperties": ["token"]
        }
      ]
    }
  ]
}

License

The MIT license