---
lang: en
title: 'API docs: openapi-v3.deprecated'
keywords: LoopBack 4.0, LoopBack 4, Node.js, TypeScript, OpenAPI
sidebar: lb4_sidebar
editurl: https://github.com/loopbackio/loopback-next/tree/master/packages/openapi-v3
permalink: /doc/en/lb4/apidocs.openapi-v3.deprecated.html
---

<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [@loopback/openapi-v3](./openapi-v3.md) &gt; [deprecated](./openapi-v3.deprecated.md)

## deprecated() function

Marks an api path as deprecated. When applied to a class, this decorator marks all paths as deprecated.

You can optionally mark all controllers in a class as deprecated, but use `@deprecated(false)` on a specific method to ensure it is not marked as deprecated in the specification.

**Signature:**

```typescript
export declare function deprecated(isDeprecated?: boolean): (target: any, method?: string, methodDescriptor?: TypedPropertyDescriptor<any>) => any;
```

## Parameters

<table><thead><tr><th>

Parameter


</th><th>

Type


</th><th>

Description


</th></tr></thead>
<tbody><tr><td markdown="1">

isDeprecated


</td><td markdown="1">

boolean


</td><td markdown="1">

_(Optional)_ whether or not the path should be marked as deprecated. This is useful for marking a class as deprecated, but a method as not deprecated.


</td></tr>
</tbody></table>

**Returns:**

(target: any, method?: string, methodDescriptor?: TypedPropertyDescriptor&lt;any&gt;) =&gt; any

## Example


```ts
@oas.deprecated()
class MyController {
  @get('/greet')
  public async function greet() {
    return 'Hello, World!'
  }

  @get('/greet-v2')
  @oas.deprecated(false)
  public async function greetV2() {
    return 'Hello, World!'
  }
}

class MyOtherController {
  @get('/echo')
  public async function echo() {
    return 'Echo!'
  }
}
```


