Skip to content

Commit

Permalink
fix: update usage of x-ts-type for schemas
Browse files Browse the repository at this point in the history
See #1933
  • Loading branch information
raymondfeng committed Oct 29, 2018
1 parent cd8a44b commit 57c694e
Show file tree
Hide file tree
Showing 8 changed files with 21 additions and 21 deletions.
8 changes: 4 additions & 4 deletions docs/site/Controller-generator.md
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ export class TodoController {
responses: {
'200': {
description: 'Todo model instance',
content: {'application/json': {'x-ts-type': Todo}},
content: {'application/json': {schema: {'x-ts-type': Todo}}},
},
},
})
Expand All @@ -131,7 +131,7 @@ export class TodoController {
responses: {
'200': {
description: 'Todo model count',
content: {'application/json': {'x-ts-type': Number}},
content: {'application/json': {schema: {'x-ts-type': Number}}},
},
},
})
Expand Down Expand Up @@ -163,7 +163,7 @@ export class TodoController {
responses: {
'200': {
description: 'Todo PATCH success count',
content: {'application/json': {'x-ts-type': Number}},
content: {'application/json': {schema: {'x-ts-type': Number}}},
},
},
})
Expand All @@ -178,7 +178,7 @@ export class TodoController {
responses: {
'200': {
description: 'Todo model instance',
content: {'application/json': {'x-ts-type': Todo}},
content: {'application/json': {schema: {'x-ts-type': Todo}}},
},
},
})
Expand Down
6 changes: 3 additions & 3 deletions docs/site/todo-list-tutorial-controller.md
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ export class TodoListController {
responses: {
'200': {
description: 'TodoList model instance',
content: {'application/json': {'x-ts-type': TodoList}},
content: {'application/json': {schema: {'x-ts-type': TodoList}}},
},
},
})
Expand All @@ -157,7 +157,7 @@ export class TodoListController {
responses: {
'200': {
description: 'Array of TodoList model instances',
content: {'application/json': {'x-ts-type': TodoList}},
content: {'application/json': {schema: {'x-ts-type': TodoList}}},
},
},
})
Expand Down Expand Up @@ -186,7 +186,7 @@ export class TodoListController {
responses: {
'200': {
description: 'TodoList model instance',
content: {'application/json': {'x-ts-type': TodoList}},
content: {'application/json': {schema: {'x-ts-type': TodoList}}},
},
},
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export class TodoListTodoController {
responses: {
'200': {
description: 'TodoList.Todo model instance',
content: {'application/json': {'x-ts-type': Todo}},
content: {'application/json': {schema: {'x-ts-type': Todo}}},
},
},
})
Expand Down
6 changes: 3 additions & 3 deletions examples/todo-list/src/controllers/todo-list.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export class TodoListController {
responses: {
'200': {
description: 'TodoList model instance',
content: {'application/json': {'x-ts-type': TodoList}},
content: {'application/json': {schema: {'x-ts-type': TodoList}}},
},
},
})
Expand All @@ -59,7 +59,7 @@ export class TodoListController {
responses: {
'200': {
description: 'Array of TodoList model instances',
content: {'application/json': {'x-ts-type': TodoList}},
content: {'application/json': {schema: {'x-ts-type': TodoList}}},
},
},
})
Expand Down Expand Up @@ -88,7 +88,7 @@ export class TodoListController {
responses: {
'200': {
description: 'TodoList model instance',
content: {'application/json': {'x-ts-type': TodoList}},
content: {'application/json': {schema: {'x-ts-type': TodoList}}},
},
},
})
Expand Down
6 changes: 3 additions & 3 deletions examples/todo-list/src/controllers/todo.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export class TodoController {
responses: {
'200': {
description: 'Todo model instance',
content: {'application/json': {'x-ts-type': Todo}},
content: {'application/json': {schema: {'x-ts-type': Todo}}},
},
},
})
Expand All @@ -36,7 +36,7 @@ export class TodoController {
responses: {
'200': {
description: 'Todo model instance',
content: {'application/json': {'x-ts-type': Todo}},
content: {'application/json': {schema: {'x-ts-type': Todo}}},
},
},
})
Expand Down Expand Up @@ -108,7 +108,7 @@ export class TodoController {
responses: {
'200': {
description: 'TodoList model instance',
content: {'application/json': {'x-ts-type': TodoList}},
content: {'application/json': {schema: {'x-ts-type': TodoList}}},
},
},
})
Expand Down
4 changes: 2 additions & 2 deletions examples/todo/src/controllers/todo.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export class TodoController {
responses: {
'200': {
description: 'Todo model instance',
content: {'application/json': {'x-ts-type': Todo}},
content: {'application/json': {schema: {'x-ts-type': Todo}}},
},
},
})
Expand All @@ -49,7 +49,7 @@ export class TodoController {
responses: {
'200': {
description: 'Todo model instance',
content: {'application/json': {'x-ts-type': Todo}},
content: {'application/json': {schema: {'x-ts-type': Todo}}},
},
},
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export class <%= className %>Controller {
responses: {
'200': {
description: '<%= modelName %> model instance',
content: {'application/json': {'x-ts-type': <%= modelName %>}},
content: {'application/json': {schema: {'x-ts-type': <%= modelName %>}}},
},
},
})
Expand Down Expand Up @@ -87,7 +87,7 @@ export class <%= className %>Controller {
responses: {
'200': {
description: '<%= modelName %> model instance',
content: {'application/json': {'x-ts-type': <%= modelName %>}},
content: {'application/json': {schema: {'x-ts-type': <%= modelName %>}}},
},
},
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ function checkRestCrudContents() {
/responses: {/,
/'200': {/,
/description: 'ProductReview model instance'/,
/content: {'application\/json': {'x-ts-type': ProductReview}},\s{1,}},\s{1,}},\s{1,}}\)/,
/content: {'application\/json': {schema: {'x-ts-type': ProductReview}}},\s{1,}},\s{1,}},\s{1,}}\)/,
/async create\(\@requestBody\(\) productReview: ProductReview\)/,
];
postCreateRegEx.forEach(regex => {
Expand All @@ -273,7 +273,7 @@ function checkRestCrudContents() {
/responses: {/,
/'200': {/,
/description: 'Array of ProductReview model instances'/,
/content: {'application\/json': {'x-ts-type': ProductReview}},\s{1,}},\s{1,}},\s{1,}}\)/,
/content: {'application\/json': {schema: {'x-ts-type': ProductReview}}},\s{1,}},\s{1,}},\s{1,}}\)/,
/async find\(\s*\@param\.query\.object\('filter', getFilterSchemaFor\(ProductReview\)\) filter\?: Filter(|,\s+)\)/,
];
getFindRegEx.forEach(regex => {
Expand All @@ -299,7 +299,7 @@ function checkRestCrudContents() {
/responses: {/,
/'200': {/,
/description: 'ProductReview model instance'/,
/content: {'application\/json': {'x-ts-type': ProductReview}},\s{1,}},\s{1,}},\s{1,}}\)/,
/content: {'application\/json': {schema: {'x-ts-type': ProductReview}}},\s{1,}},\s{1,}},\s{1,}}\)/,
/async findById\(\@param.path.number\('id'\)/,
];
getFindByIdRegEx.forEach(regex => {
Expand Down

0 comments on commit 57c694e

Please sign in to comment.