# collectionPathFor

**Kind:** Function

**Source:** [`atloria-monorepo/libs/parser-core/src/openapi/param-source-inference.ts`](https://github.com/sherkety/atloria/blob/main/atloria-monorepo/libs/parser-core/src/openapi/param-source-inference.ts#L72)

The collection that lists the values for `{param}`: everything up to the segment before it.
`/projects/{projectId}` → `/projects`. Composes for nested resources, so
`/projects/{projectId}/documents/{documentId}` → `/projects/{projectId}/documents`.

## Signature

```ts
function collectionPathFor(path: string, param: string): string | null
```

## Parameters

| Name | Type |
|---|---|
| `path` | `string` |
| `param` | `string` |

**Returns:** `string | null`
