Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ability to extend class with some methods #944

Open
ofw opened this issue Jul 31, 2020 · 0 comments
Open

Ability to extend class with some methods #944

ofw opened this issue Jul 31, 2020 · 0 comments
Labels
enhancement New feature or request

Comments

@ofw
Copy link

ofw commented Jul 31, 2020

It would be great to have ability to inherit some base behavior.
For example, when each HTTP endpoint can return 400 and 500 error with a known schema.

Now those methods are not generated in openapi file.

Example:

class BaseEndpoint {

    @response({ status: 400 })
    badRequest(@body body: BadRequestError) { }

    @response({ status: 500 })
    internalError(@body body: InternalError) { }
}

@endpoint({
    method: "POST",
    path: "/a"
})
class EndpointA extends BaseEndpoint {
    @request
    request(@body body: ReqA) { }
}

@endpoint({
    method: "POST",
    path: "/b"
})
class EndpointB extends BaseEndpoint {
    @request
    request(@body body: ReqB) { }
}
@lfportal lfportal added the enhancement New feature or request label Aug 1, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants