# Import OpenAPI from URL doesn't resolve external $refs

**URL:** <https://community.postman.com/t/import-openapi-from-url-doesnt-resolve-external-refs/48833>\
**Category:** Help Hub\
**Tags:** openapi\
**Created:** [June 22, 2023, 5:58pm UTC](https://community.postman.com/t/import-openapi-from-url-doesnt-resolve-external-refs/48833 "2023-06-22T17:58:22Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![denis](https://avatars.discourse-cdn.com/v4/letter/d/5e9695/32.png) [@denis](https://community.postman.com/u/denis)\
**Post date:** [June 22, 2023, 5:58pm UTC](https://community.postman.com/t/import-openapi-from-url-doesnt-resolve-external-refs/48833/1 "2023-06-22T17:58:22Z")

</div>

When I import an OpenAPI spec that has external $refs, it imports fine if I import the folder from disk (where the folder has all the relevant files), but importing from URL doesn’t work – although the references are valid relative URLs. By comparison, the Swagger UI that uses the same source specs correctly resolves those refs.

For example, in my `openapi.json` I have a reference like:

```auto
{
"$ref": "getall-query-params.json#/components/parameters/filter"
},

```

If my `openapi.json` URL is, for example, `http://localhost:9001/api-docs/openapi.json`, the relative URL resolves to `http://localhost:9001/api-docs/getall-query-params.json`, and that resource is available and can be accessed.

And these $refs are resolved correctly either by Swagger UI OR if I import a folder to Postman, where the folder contents are:

```auto
getall-query-params.json
openapi.json

```

But if I import to Postman just using the URL `http://localhost:9001/api-docs/openapi.json`, it imports most of the spec just fine but misses those external refs.
