# VERSION_NEUTRAL

**Kind:** Constant

**Source:** [`packages/common/interfaces/version-options.interface.ts`](https://github.com/nestjs/nest/blob/master/packages/common/interfaces/version-options.interface.ts#L8)

**Part of:** [Common](subsystem-packages-common)

Indicates that this will work for any version passed in the request, or no version.

`VERSION_NEUTRAL` is a versioning constant that marks a route or controller as compatible with every API version. It allows an endpoint to handle requests regardless of whether a version is specified in the request, providing a fallback for version-neutral functionality.

## Definition

```ts
Symbol('VERSION_NEUTRAL')
```

## Value

```ts
Symbol('VERSION_NEUTRAL')
```

## Diagram

```mermaid
graph LR
  Request[Incoming Request] --> VersionCheck{Version specified?}
  VersionCheck -->|Yes| VersionedRoute[Version-specific Route]
  VersionCheck -->|No or Any Version| NeutralRoute[VERSION_NEUTRAL Route]
  NeutralRoute --> Handler[Route Handler]
```

## Usage

```ts
import { Controller, Get, VERSION_NEUTRAL } from '@nestjs/common';

@Controller({
  path: 'health',
  version: VERSION_NEUTRAL,
})
export class HealthController {
  @Get()
  check() {
    return { status: 'ok' };
  }
}
```

## AI Coding Instructions

- Use `VERSION_NEUTRAL` for endpoints that must remain accessible across all API versions, such as health checks or shared metadata routes.
- Apply it through controller or route version metadata where Nest versioning is enabled.
- Do not use it for endpoints whose response contract changes between API versions.
- Ensure version-neutral routes do not conflict with version-specific routes using the same HTTP method and path.
- Test requests both with and without version information to confirm the route is resolved as expected.

## Used by

7 references from 7 files. Each is a place in this repository where the symbol is actually used — go read one rather than trusting an example.

### Imported by (7)

- `RoutePathFactory` — `packages/core/router/route-path-factory.ts`:18
- `VersionNeutralMiddlewareController` — `integration/versioning/src/neutral-middleware.controller.ts`:3
- `VersionNeutralController` — `integration/versioning/src/neutral.controller.ts`:3
- `modulesContainer` — `packages/core/middleware/routes-mapper.ts`:148
- `MODULE_INIT_MESSAGE` — `packages/core/helpers/messages.ts`:7
- `ExpressAdapter` — `packages/platform-express/adapters/express-adapter.ts`:51
- `FastifyAdapter` — `packages/platform-fastify/adapters/fastify-adapter.ts`:124
