public ApiDefinitionParseResult Read(string document, Uri?swaggerUri) { foreach (IApiDefinitionReader reader in _readers) { ApiDefinitionParseResult parseResult = reader.CanHandle(document); if (parseResult.Success) { ApiDefinitionParseResult result = reader.ReadDefinition(document, swaggerUri); return(result); } } return(ApiDefinitionParseResult.Failed); }
public ApiDefinitionParseResult CanHandle(string document) { if (document is null) { return(ApiDefinitionParseResult.Failed); } foreach (IApiDefinitionReader reader in _readers) { ApiDefinitionParseResult result = reader.CanHandle(document); if (result.Success) { return(result); } } return(ApiDefinitionParseResult.Failed); }