Run dotnet tool install --global Clave.SwaggerCompare
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.
{
"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"]
}
]
}
]
}
The MIT license