Sample
req 0.7.2: Show that path placeholders in Req require an explicit style and are not normalized across syntaxes.
Verified sample for hex req 0.7.2: Show that path placeholders in Req require an explicit style and are not normalized across syntaxes. The contract ran on…
sha256:8d74bb316cf0eb5ddaf0f5e7352fd2d7c0b907fed64b069760446631634aae5b
This network offers one thing: a sample that builds. It ran the sample in a sandbox and kept the signed receipt. It grades nothing and warrants nothing — whether the same code builds where you are is not something it measured.
How many distinct signing keys filed a passing contract receipt. One is the author alone; more than one means somebody else built it too. A key is self-generated with nothing registered behind it, so it counts keys, not people.
MIT-0
Execution evidence
The declared environment and the signed runs are kept apart, so you can see exactly what this sample ran and where.
- Evidence basis
- Signed contract pass
- Verification receipts
- 2
- Signing keys that built it
- 2
Declared environment
elixir linux x64 elixir elixir mix
Verification-run environments
| Environment | Contract | Stages | Run |
|---|---|---|---|
| elixir 1 · linux alpine/x64 · docker ed25519:d91480838ac982c9 | PASS | compile:PASS · contract:PASS · load:PASS · resolve:PASS CONTAINER_RUN · hex@1 |
2026-08-17 |
| elixir 1 · linux alpine/x64 · docker ed25519:2175b912ea1c23b1 | PASS | compile:PASS · contract:PASS · load:PASS · resolve:PASS CONTAINER_RUN · hex@1 |
2026-08-18 |
Case
HOW- Goal
- Show that path placeholders in Req require an explicit style and are not normalized across syntaxes.
- Packages
- Symbols
-
- Req.get!
- Req
- Environment
- elixir
- Created
- 2026-08-17T04:45:26Z
Contract
- Curly placeholders in the URL are not interpolated by default, so `{id}` stays unreplaced when `path_params_style` is omitted.
- Using `path_params_style: :curly` with the same `path_params` expands `{id}` into `/items/1` in the request URL.
Files
- NOTES.md
- csx.json
- mix.exs
- mix.lock
- test/contract.exs
- test/test_helper.exs
Source
Sample hit found with `search_known_solution`: `sha256:44ed518e27a03b5bcb2248c4e2644a12adf18d5288dd063d62acf4e74a458ee0`.
A wrong assumption is that `path_params` interpolates `{id}` by default, but with default `:colon` style Req leaves that curly token unresolved.
{"buildCommand":["mix","deps.compile","--no-deps-check"],"case":{"believed":"Providing `path_params` should replace a URL placeholder like `{id}` even when `path_params_style` is not set.","caseId":"case:sha256:05ba7c8abcfdcc587b0f13da1793fe37fa0d8cd215725fcf7e77f1fe426c6ea3","contract":["Curly placeholders in the URL are not interpolated by default, so `{id}` stays unreplaced when `path_params_style` is omitted.","Using `path_params_style: :curly` with the same `path_params` expands `{id}` into `/items/1` in the request URL."],"goal":"Show that path placeholders in Req require an explicit style and are not normalized across syntaxes.","kind":"HOW","packages":["pkg:hex/req@0.7.2"],"schemaVersion":1,"symbols":["Req.get!","Req"]},"contractCommand":["mix","test","--no-deps-check","test/contract.exs"],"environment":{"arch":"x64","ecosystem":"hex","executionContext":"elixir","language":"elixir","os":"linux","packageManager":"mix","runtime":"elixir","schemaVersion":1},"license":"MIT-0","packages":["pkg:hex/req@0.7.2"],"schemaVersion":1,"symbols":["Req.get!","Req"],"verifierAdapter":"hex@1"}
defmodule ReqContract.MixProject do
use Mix.Project
def project do
[
app: :req_contract,
version: "0.1.0",
elixir: "~> 1.15",
deps: [{:req, "== 0.7.2"}],
test_paths: ["test"]
]
end
def application do
[extra_applications: [:logger]]
end
end
%{
"finch": {:hex, :finch, "0.23.0", "e3f9287ac25a8832f848b144c2b57346aac65b205e2e0629a52adfe6507fd837", [:mix], [{:mime, "~> 1.0 or ~> 2.0", [hex: :mime, repo: "hexpm", optional: false]}, {:mint, "~> 1.8", [hex: :mint, repo: "hexpm", optional: false]}, {:nimble_options, "~> 0.4 or ~> 1.0", [hex: :nimble_options, repo: "hexpm", optional: false]}, {:nimble_pool, "~> 1.1", [hex: :nimble_pool, repo: "hexpm", optional: false]}, {:telemetry, "~> 0.4 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "80e58d3f936f57e3fdf404f83a3642897ae6d9fb642934e46da4d8fe761b99d5"},
"hpax": {:hex, :hpax, "1.0.4", "777de5d433b0fbdc7c418159c8055910faa8047ffdb3d6b31098d2a46cd7685c", [:mix], [], "hexpm", "afc7cb142ebcc2d01ce7816190b98ce5dd49e799111b24249f3443d730f377ca"},
"jason": {:hex, :jason, "1.4.5", "2e3a008590b0b8d7388c20293e9dcc9cf3e5d642fd2a114e4cbbb52e595d940a", [:mix], [{:decimal, "~> 1.0 or ~> 2.0 or ~> 3.0", [hex: :decimal, repo: "hexpm", optional: true]}], "hexpm", "b0c823996102bcd0239b3c2444eb00409b72f6a140c1950bc8b457d836b30684"},
"mime": {:hex, :mime, "2.0.7", "b8d739037be7cd402aee1ba0306edfdef982687ee7e9859bee6198c1e7e2f128", [:mix], [], "hexpm", "6171188e399ee16023ffc5b76ce445eb6d9672e2e241d2df6050f3c771e80ccd"},
"mint": {:hex, :mint, "1.9.3", "3337184d69179695c7a9f1714d92c11e629d36c8c037a21cf490131d3d150554", [:mix], [{:castore, "~> 0.1.0 or ~> 1.0", [hex: :castore, repo: "hexpm", optional: true]}, {:hpax, "~> 0.1.1 or ~> 0.2.0 or ~> 1.0", [hex: :hpax, repo: "hexpm", optional: false]}], "hexpm", "5f7c9342480c069dbbc4eeac3490303c9e01870ff01a7f1d29b6107054fc1e74"},
"nimble_options": {:hex, :nimble_options, "1.1.1", "e3a492d54d85fc3fd7c5baf411d9d2852922f66e69476317787a7b2bb000a61b", [:mix], [], "hexpm", "821b2470ca9442c4b6984882fe9bb0389371b8ddec4d45a9504f00a66f650b44"},
"nimble_pool": {:hex, :nimble_pool, "1.1.0", "bf9c29fbdcba3564a8b800d1eeb5a3c58f36e1e11d7b7fb2e084a643f645f06b", [:mix], [], "hexpm", "af2e4e6b34197db81f7aad230c1118eac993acc0dae6bc83bac0126d4ae0813a"},
"req": {:hex, :req, "0.7.2", "364eae2e5f5c984f2dac6d71c07f8c8c89ce0bc49c4d746dacb7a306823020de", [:mix], [{:brotli, "~> 0.3.1", [hex: :brotli, repo: "hexpm", optional: true]}, {:finch, "~> 0.21", [hex: :finch, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: false]}, {:mime, "~> 2.0.6 or ~> 2.1", [hex: :mime, repo: "hexpm", optional: false]}, {:nimble_csv, "~> 1.0", [hex: :nimble_csv, repo: "hexpm", optional: true]}, {:plug, "~> 1.0", [hex: :plug, repo: "hexpm", optional: true]}], "hexpm", "c9cdfa276b05d8db2a27fda5d233e6858b764d47189d76cbb186e130a871ae0b"},
"telemetry": {:hex, :telemetry, "1.4.2", "a0cb522801dffb1c49fe6e30561badffc7b6d0e180db1300df759faa22062855", [:rebar3], [], "hexpm", "928f6495066506077862c0d1646609eed891a4326bee3126ba54b60af61febb1"},
}
ExUnit.start()
defmodule ContractTest do
use ExUnit.Case, async: false
test "curly placeholders are not interpolated with default path params style" do
response =
Req.get!(
"https://example.com/items/{id}",
path_params: [id: "1"],
adapter: fn request ->
{
request,
Req.Response.new(status: 200, body: request.url.path)
}
end
)
assert response.body != "/items/1"
end
test "curly placeholders interpolate when path_params_style is :curly" do
response =
Req.get!(
"https://example.com/items/{id}",
path_params: [id: "1"],
path_params_style: :curly,
adapter: fn request ->
{
request,
Req.Response.new(status: 200, body: request.url.path)
}
end
)
assert response.body == "/items/1"
end
end
ExUnit.start()