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/types-and-parameters.md
+12Lines changed: 12 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -288,3 +288,15 @@ pets: Pet[];
288
288
> info **Hint** The `getSchemaPath()` function is imported from `@nestjs/swagger`.
289
289
290
290
Both `Cat` and `Dog` must be defined as extra models using the `@ApiExtraModels()` decorator (at the class-level).
291
+
292
+
### Schema
293
+
294
+
As you might have noticed the name of the generated model schema matches the name of the model class e.g. `CreateCatDto` will generate `CreateCatDto` schema. If you want to change the generated schema name then use `@ApiSchema()` decorator.
295
+
296
+
For example:
297
+
```typescript
298
+
@ApiSchema({ name: 'CreateCatRequest' })
299
+
class CreateCatDto {}
300
+
```
301
+
302
+
The above model will translate into schema with name `CreateCatRequest`.
0 commit comments