import requests
import json
from typing import OrderedDict


def load_json_schema_fromURL(url):
    """
    load the JSON schema file
    :param url: location of schema file,
        e.g. https://openconnectivityfoundation.github.io/IoTDataModels/schemas/oic.baseresource.properties-schema.json#/definitions/range_integer
    :return: json_dict
    """
    response = requests.get(url)
    json_dict = json.loads(response.text, parse_float=float,
                           object_pairs_hook=OrderedDict)
    return json_dict