# File extensions as path variables

**URL:** <https://community.postman.com/t/file-extensions-as-path-variables/10572>\
**Category:** Help Hub\
**Tags:** collections\
**Created:** [February 5, 2020, 12:07pm UTC](https://community.postman.com/t/file-extensions-as-path-variables/10572 "2020-02-05T12:07:05Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![cbetta](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/cbetta/32/3754_2.png) [@cbetta](https://community.postman.com/u/cbetta)\
**Post date:** [February 5, 2020, 12:07pm UTC](https://community.postman.com/t/file-extensions-as-path-variables/10572/1 "2020-02-05T12:07:06Z")

</div>

I am working on an API that allows a user to get a thumbnail representation of a file.

```
GET /files/:id/thumbnail.:extension

```

As you can see, the extension is a variable that can either be `jpg` or `png`. I’ve been able to model this just fine in our OAS3 file but it seems like Postman doesn’t recognise this path variable. Does anyone know how I could achieve this in Postman?

---

<div class="post-metadata">

**Author:** ![allenheltondev](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/allenheltondev/32/31738_2.png) [@allenheltondev](https://community.postman.com/u/allenheltondev)\
**Post date:** [February 5, 2020, 2:31pm UTC](https://community.postman.com/t/file-extensions-as-path-variables/10572/2 "2020-02-05T14:31:46Z")

</div>

I have a way you can do it in Postman, but I’m not 100% sure on the implications it would have on your OAS3 spec.

Pull the word thumbnail into your path variable and concatenate your environment variable to it

 ![image](https://us1.discourse-cdn.com/getpostman/original/3X/8/3/83a433ad169b6850be881c934f5c7785a86f4808.png)

---

<div class="post-metadata">

**Author:** ![cbetta](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/cbetta/32/3754_2.png) [@cbetta](https://community.postman.com/u/cbetta)\
**Post date:** [February 5, 2020, 3:59pm UTC](https://community.postman.com/t/file-extensions-as-path-variables/10572/3 "2020-02-05T15:59:14Z")

</div>

Yeah that’s what I was thinking of too.

Seems like a hack though to work around Postman’s limitations.

It also messes with the OpenAPI spec, as now the path matches another path to some degree.

---

<div class="post-metadata">

**Author:** ![allenheltondev](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/allenheltondev/32/31738_2.png) [@allenheltondev](https://community.postman.com/u/allenheltondev)\
**Post date:** [February 5, 2020, 4:42pm UTC](https://community.postman.com/t/file-extensions-as-path-variables/10572/4 "2020-02-05T16:42:08Z")

</div>

Another way you could go is that if the thumbnail can be either jpg or png like you said, you can extend the route and still be RESTful

/files/:id/thumbnails/:extension  
or  
/files/:id/thumbnails/extensions/:extension

---

<div class="post-metadata">

**Author:** ![cbetta](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/cbetta/32/3754_2.png) [@cbetta](https://community.postman.com/u/cbetta)\
**Post date:** [February 5, 2020, 7:20pm UTC](https://community.postman.com/t/file-extensions-as-path-variables/10572/5 "2020-02-05T19:20:01Z")

</div>

Ha. Sadly this API has been out for a while and I do not control making that change.
