# Delimiting a path variable (or path parameter) when it's a part of the file name

**URL:** <https://community.postman.com/t/delimiting-a-path-variable-or-path-parameter-when-its-a-part-of-the-file-name/43798>\
**Category:** Help Hub\
**Created:** [February 9, 2023, 10:58pm UTC](https://community.postman.com/t/delimiting-a-path-variable-or-path-parameter-when-its-a-part-of-the-file-name/43798 "2023-02-09T22:58:22Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![passiday](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/passiday/32/14788_2.png) [@passiday](https://community.postman.com/u/passiday)\
**Post date:** [February 9, 2023, 10:58pm UTC](https://community.postman.com/t/delimiting-a-path-variable-or-path-parameter-when-its-a-part-of-the-file-name/43798/1 "2023-02-09T22:58:22Z")

</div>

I am testing [Discourse API](https://docs.discourse.org/). To [retrieve a single post](https://docs.discourse.org/#tag/Posts/operation/getPost), the syntax is GET `/posts/{id}.json`.

The post id, obviously, is a good candidate for a path variable. However, if I write in the URL bar `{{host}}/posts/:id.json`, Postman considers the path variable name is `id.json` rather than just `id`. Is there a way to delimit the path variable definition so that it replaces just the “id”?

The [docs on variables](https://learning.postman.com/docs/sending-requests/requests/#sending-parameters) does not specify any closing delimiter, it seems that the path parameter name ends at slash or at line end.

---

<div class="post-metadata">

**Author:** ![michaelderekjones](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/michaelderekjones/32/14819_2.png) [@michaelderekjones](https://community.postman.com/u/michaelderekjones)\
**Post date:** [February 10, 2023, 11:12am UTC](https://community.postman.com/t/delimiting-a-path-variable-or-path-parameter-when-its-a-part-of-the-file-name/43798/2 "2023-02-10T11:12:31Z")

</div>

That’s not really a path, but a filename.

Therefore I would have thought it should be…

```auto
{{host}}/posts/{{id}}.json

```

just store the ID as a collection or environment variable, and your good to go.

---

<div class="post-metadata">

**Author:** ![passiday](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/passiday/32/14788_2.png) [@passiday](https://community.postman.com/u/passiday)\
**Post date:** [February 10, 2023, 11:43am UTC](https://community.postman.com/t/delimiting-a-path-variable-or-path-parameter-when-its-a-part-of-the-file-name/43798/3 "2023-02-10T11:43:41Z")

</div>

Yeah, that’s a valid workaround, but it would be nicer to have that value tied to the request, and visible/accessible in the request’s UI.  
I am now using `{{host}}/posts/:id`, and populating this `id` path variable with `1234.json`. Not ideal, but ok.

---

<div class="post-metadata">

**Author:** ![michaelderekjones](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/michaelderekjones/32/14819_2.png) [@michaelderekjones](https://community.postman.com/u/michaelderekjones)\
**Post date:** [February 10, 2023, 11:58am UTC](https://community.postman.com/t/delimiting-a-path-variable-or-path-parameter-when-its-a-part-of-the-file-name/43798/4 "2023-02-10T11:58:23Z")

</div>

I think you hit the nail on the head in your initial post.

Postman is expecting a path element to end with / or a space.

I’d have to look up the URL standard but in my mind if something ends with .extension, then its a filename rather than a path, so sounds like Postman is interpreting it correctly.

Sounds like you have two workarounds, so all good.
