You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: content/openapi/cli-plugin.md
+23-7Lines changed: 23 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -91,7 +91,7 @@ You must duplicate both description and example values. With `introspectComments
91
91
roles: RoleEnum[] = [];
92
92
```
93
93
94
-
There are `dtoKeyOfComment` and `controllerKeyOfComment` plugin options that you can use to customize how the plugin will set the value for `ApiProperty` and `ApiOperation` decorators respectively. Take a look at the following example:
94
+
There are `dtoKeyOfComment` and `controllerKeyOfComment` plugin options available for customizing how the plugin assigns values to the `ApiProperty` and `ApiOperation` decorators, respectively. See the example below:
95
95
96
96
```typescript
97
97
exportclassSomeController {
@@ -103,13 +103,29 @@ export class SomeController {
103
103
}
104
104
```
105
105
106
-
By default, these options are set to `"description"`. This means the plugin will assign `"Create some resource"`to `description` key on the `ApiOperation` operator. Like so:
106
+
This is equivalent to the following instruction:
107
107
108
-
```ts
109
-
@ApiOperation({ description: "Create some resource" })
108
+
```typescript
109
+
@ApiOperation({ summary: "Create some resource" })
110
110
```
111
111
112
-
> info **Hint** For models, the same logic applies but to `ApiProperty` decorator instead.
112
+
> info **Hint** For models, the same logic applies but is used with the `ApiProperty` decorator instead.
113
+
114
+
For controllers, you can provide not only a summary but also a description (remarks), tags (such as` @deprecated`), and response examples, like this:
115
+
116
+
```ts
117
+
/**
118
+
* Create a new cat
119
+
*
120
+
* @remarks This operation allows you to create a new cat.
0 commit comments