mirror of
https://github.com/btcpayserver/btcpayserver.git
synced 2025-03-13 11:35:51 +01:00
fix swagger validation test
This commit is contained in:
parent
f8f358ebdb
commit
98a48cd0a5
1 changed files with 7 additions and 0 deletions
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue