mirror of
https://github.com/aljazceru/btcpayserver.git
synced 2026-02-08 07:44:25 +01:00
fix swagger validation test
This commit is contained in:
@@ -102,6 +102,13 @@ namespace BTCPayServer.Tests
|
||||
var schema = JSchema.Parse(await resp.Content.ReadAsStringAsync());
|
||||
IList<ValidationError> errors;
|
||||
bool valid = swagger.IsValid(schema, out errors);
|
||||
//the schema is not fully compliant to the spec. We ARE allowed to have multiple security schemas.
|
||||
if (!valid && errors.Count == 1 && errors.Any(error =>
|
||||
error.Path == "components.securitySchemes.Basic" && error.ErrorType == ErrorType.OneOf))
|
||||
{
|
||||
errors = new List<ValidationError>();
|
||||
valid = true;
|
||||
}
|
||||
Assert.Empty(errors);
|
||||
Assert.True(valid);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user