readOpenApi function

Future<Map> readOpenApi(
  1. Uri uri
)

Implementation

Future<Map<dynamic, dynamic>> readOpenApi(Uri uri) async {
  if (uri.isScheme('HTTP') || uri.isScheme('HTTPS')) {
    final response = await get(uri);
    final content = response.body;
    return _parseContent(uri.path, content);
  } else {
    final path = _uri.fromUri(uri);
    final content = File(path).readAsStringSync();
    return _parseContent(path, content);
  }
}