# Request with that has a path parameter directly on the operation

A request that sends a request with a path parameter as a property of the input model

## TypeSpec

The path parameter is a property of a spread model input in the operation signature

```tsp
@service(#{ title: "Widget Service" })
namespace DemoService;

model ReadParams {
  @path
  id: string;
}

@route("/widgets")
@tag("Widgets")
interface Widgets {
  @test @get read(...ReadParams): void;
}
```

## TyeScript

### Operations

It should generate an operation that places the path parameter in the url template.

```ts src/api/widgetsClient/widgetsClientOperations.ts function read
export async function read(
  client: WidgetsClientContext,
  id: string,
  options?: ReadOptions,
): Promise<void> {
  const path = parse("/widgets/{id}").expand({
    id: id,
  });
  const httpRequestOptions = {
    headers: {},
  };
  const response = await client.pathUnchecked(path).get(httpRequestOptions);

  if (typeof options?.operationOptions?.onResponse === "function") {
    options?.operationOptions?.onResponse(response);
  }
  if (+response.status === 204 && !response.body) {
    return;
  }
  throw createRestError(response);
}
```
