protected function doResolve()
    {
        // @TODO Better handling of getting the content of a file
        $json = file_get_contents((string) $this->mergedUri->withFragment(''));

        if (!json_decode($json) || JSON_ERROR_NONE !== json_last_error()) {
            $decoded = Yaml::parse($json, Yaml::PARSE_OBJECT | Yaml::PARSE_OBJECT_FOR_MAP | Yaml::PARSE_DATETIME | Yaml::PARSE_EXCEPTION_ON_INVALID_TYPE);
            $json = json_encode($decoded);
        }

        $pointer = new Pointer($json);

        if ('' === $this->mergedUri->getFragment()) {
            return json_decode($json);
        }

        return $pointer->get($this->mergedUri->getFragment());
    }