Skip to content

use base class and inheriting twice is broken #1124

Closed
@wamasimba

Description

@wamasimba

Description

When using a base class to implement some methods, and inheriting more than once from it, only the first class gets the methods as actions in getMetadataArgsStorage().

import { Controller, Get, Post } from 'routing-controllers';

export class BaseContr {
    @Get('/get') getSome() {
        return 'some';
    }
    @Post('/post') postSome() {}
}

@Controller('/api/c1')
export class Contr1 extends BaseContr {}

@Controller('/api/c2')
export class Contr2 extends BaseContr {}

Expected behavior

Would expect multiple action records, for the same action in different derived controllers. So that they get called on their respective URLs.

Actual behavior

Only seeing in the actions array the methods for Contr1, not those of Contr2; this results in the URLs of Contr2 returning 404

Metadata

Metadata

Assignees

No one assigned

    Labels

    status: needs triageIssues which needs to be reproduced to be verified report.type: fixIssues describing a broken feature.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions