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
On contrast, if `lb4 openapi --promote-anonymous-schemas` is used, two
230
+
additional model files are generated:
231
+
232
+
{% include code-caption.html content="src/models/perform-search-body.model.ts" %}
233
+
234
+
```ts
235
+
/* tslint:disable:no-any */
236
+
import {model, property} from '@loopback/repository';
237
+
238
+
/**
239
+
* The model class is generated from OpenAPI schema - performSearchBody
240
+
* performSearchBody
241
+
*/
242
+
@model({name: 'performSearchBody'})
243
+
export class PerformSearchBody {
244
+
constructor(data?: Partial<PerformSearchBody>) {
245
+
if (data != null && typeof data === 'object') {
246
+
Object.assign(this, data);
247
+
}
248
+
}
249
+
250
+
/**
251
+
* Uses Lucene Query Syntax in the format of propertyName:value, propertyName:[num1 TO num2] and date range format: propertyName:[yyyyMMdd TO yyyyMMdd]. In the response please see the 'docs' element which has the list of record objects. Each record structure would consist of all the fields and their corresponding values.
252
+
*/
253
+
@property({name: 'criteria'})
254
+
criteria: string = '*:*';
255
+
256
+
/**
257
+
* Starting record number. Default value is 0.
258
+
*/
259
+
@property({name: 'start'})
260
+
start?: number = 0;
261
+
262
+
/**
263
+
* Specify number of rows to be returned. If you run the search with default values, in the response you will see 'numFound' attribute which will tell the number of records available in the dataset.
264
+
*/
265
+
@property({name: 'rows'})
266
+
rows?: number = 100;
267
+
}
268
+
```
269
+
270
+
{% include code-caption.html content="src/models/perform-search-response-body.model.ts" %}
271
+
272
+
```ts
273
+
export type PerformSearchResponseBody = {
274
+
[additionalProperty: string]: {};
275
+
}[];
276
+
```
277
+
278
+
3. The generator groups operations (`paths.<path>.<verb>`) by tags. If no tag is
279
+
present, it defaults to `OpenApi`. For each tag, a controller class is
280
+
generated as `src/controllers/<tag-name>.controller.ts` to hold all
281
+
operations with the same tag.
142
282
143
283
Controller class names are derived from tag names. The `x-controller-name`
144
284
property of an operation can be used to customize the controller name. Method
0 commit comments