Skip to content

Global tool for comparing API responses from two different APIs based on GET requests in Swagger definition.

License

Notifications You must be signed in to change notification settings

ClaveConsulting/SwaggerCompare

Repository files navigation

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

About

Global tool for comparing API responses from two different APIs based on GET requests in Swagger definition.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages