Skip to content

Commit

Permalink
when file suffix is missing, assume JSON feed
Browse files Browse the repository at this point in the history
  • Loading branch information
fangq committed Mar 30, 2022
1 parent 07c58f3 commit dd9e9c6
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion jdatadecode.m
Original file line number Diff line number Diff line change
Expand Up @@ -481,7 +481,12 @@
case {'.h5','.hdf5','.snirf'} % this requires EasyH5 toolbox
newdata=loadh5(uripath, opt);
otherwise
warning('_DataLink_ file type is not supported');
% _DataLink_ url does not specify type, assuming JSON format
if(regexpi(datalink,'^\s*(http|https|ftp|file)://'))
newdata=loadjson(uripath, opt);
else
warning('_DataLink_ url is not supported')
end
end
if(~isempty(ref.jsonpath))
newdata=getfromjsonpath(newdata,ref.jsonpath);
Expand Down

0 comments on commit dd9e9c6

Please sign in to comment.