Skip to content

defining a nested array model property using @property.array decorator crashes the app #4754

@alyhegazy

Description

@alyhegazy

Steps to reproduce

define a nested array model property like the following

import {Model, property} from '@loopback/repository';

class testModel extends Model {
  @property.array(Array)
  nestedArr: Array<Array<string>>;
}

Current Behavior

The app crashes with the error Cannot start the application. Error: "items" property must be present if "type" is an array

Expected Behavior

The nested array property should be defined without problems. Would be nice to also allow defining the type of the nested array for example @property.array(Array<string>).

Link to reproduction sandbox

Additional information

darwin x64 10.19.0
├── @loopback/authentication@3.3.1
├── @loopback/authorization@0.4.9
├── @loopback/boot@1.7.2
├── @loopback/context@2.0.0
├── @loopback/core@1.12.2
├── @loopback/openapi-v3@1.12.0
├── @loopback/rest@1.26.0
└── @loopback/rest-explorer@1.4.8

Related Issues

See Reporting Issues for more tips on writing good issues

Acceptance Criteria

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions