Skip to content

Model.toMap should include superClass properties #117

@nikooiko

Description

@nikooiko

Bug or feature request

  • Bug
  • Feature request

Description of feature (or steps to reproduce if bug)

Here is the actual call stack
Model.toMap() > VirtualObject.toMap() > BeanUtil.getProperties(model, false, false);

BeanUtil.getProperties is called with hardcoded false (second param) that doesn't allow the model to include it's parent's properties.

I think that there should be a way to include model's parent properties when calling toMap(). For example if we define a model AppUser that extends User, appUser.save() (that internally calls Model.toMap) should include password property, defined at User class.

Current work around is to redefine the getters for the properties we want to include.

Link to sample repo to reproduce issue (if bug)

Expected result

If a model extends another model (eg AppUser that extends User) should probably include it's parents properties.

Actual result (if bug)

Only the model's properties.

Additional information (Node.js version, LoopBack version, etc)

LB Android SDK: 1.5.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions