Skip to content

Commit d59e116

Browse files
author
Stefan Radacovsky
committed
revert: docu(@nestjs/swagger) Describe @ApiSchema decorator
This reverts commit b8d782c.
1 parent b8d782c commit d59e116

File tree

5 files changed

+9
-28
lines changed

5 files changed

+9
-28
lines changed

content/openapi/decorators.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,5 +22,4 @@ All of the available OpenAPI decorators have an `Api` prefix to distinguish them
2222
| `@ApiProperty()` | Model |
2323
| `@ApiPropertyOptional()` | Model |
2424
| `@ApiHideProperty()` | Model |
25-
| `@ApiSchema()` | Model |
2625
| `@ApiExtension()` | Method |

content/openapi/model-schema.md renamed to content/openapi/types-and-parameters.md

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -288,15 +288,3 @@ pets: Pet[];
288288
> info **Hint** The `getSchemaPath()` function is imported from `@nestjs/swagger`.
289289

290290
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`.

src/app/homepage/menu/menu.component.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -181,8 +181,8 @@ export class MenuComponent implements OnInit {
181181
children: [
182182
{ title: 'Introduction', path: '/openapi/introduction' },
183183
{
184-
title: 'Model schema',
185-
path: '/openapi/model-schema',
184+
title: 'Types and Parameters',
185+
path: '/openapi/types-and-parameters',
186186
},
187187
{ title: 'Operations', path: '/openapi/operations' },
188188
{ title: 'Security', path: '/openapi/security' },

src/app/homepage/pages/openapi/openapi.module.ts

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,24 +10,18 @@ import { OpenApiMigrationGuideComponent } from './migration-guide/migration-guid
1010
import { OperationsComponent } from './operations/operations.component';
1111
import { OpenApiOtherFeaturesComponent } from './other-features/other-features.component';
1212
import { OpenApiSecurityComponent } from './security/security.component';
13-
import { ModelSchemaComponent } from './model-schema/model-schema.component';
13+
import { TypesAndParametersComponent } from './types-and-parameters/types-and-parameters.component';
1414

1515
const routes: Routes = [
1616
{
1717
path: 'introduction',
1818
component: IntroductionComponent,
1919
data: { title: 'OpenAPI (Swagger)' },
2020
},
21-
{
22-
path: 'model-schema',
23-
component: ModelSchemaComponent,
24-
data: { title: 'Model Schema - OpenAPI' },
25-
},
26-
// Keep old route to not break existing bookmarks
2721
{
2822
path: 'types-and-parameters',
29-
component: ModelSchemaComponent,
30-
data: { title: 'Model Schema - OpenAPI' },
23+
component: TypesAndParametersComponent,
24+
data: { title: 'Types and Parameters - OpenAPI' },
3125
},
3226
{
3327
path: 'operations',
@@ -69,7 +63,7 @@ const routes: Routes = [
6963
@NgModule({
7064
imports: [CommonModule, SharedModule, RouterModule.forChild(routes)],
7165
declarations: [
72-
ModelSchemaComponent,
66+
TypesAndParametersComponent,
7367
OpenApiMigrationGuideComponent,
7468
OpenApiOtherFeaturesComponent,
7569
OperationsComponent,

src/app/homepage/pages/openapi/model-schema/model-schema.component.ts renamed to src/app/homepage/pages/openapi/types-and-parameters/types-and-parameters.component.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ import { ChangeDetectionStrategy, Component } from '@angular/core';
22
import { BasePageComponent } from '../../page/page.component';
33

44
@Component({
5-
selector: 'app-openapi-model-schema',
6-
templateUrl: './model-schema.component.html',
5+
selector: 'app-openapi-types-parameters',
6+
templateUrl: './types-and-parameters.component.html',
77
changeDetection: ChangeDetectionStrategy.OnPush,
88
})
9-
export class ModelSchemaComponent extends BasePageComponent {}
9+
export class TypesAndParametersComponent extends BasePageComponent {}

0 commit comments

Comments
 (0)