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

for discussion: allow class derivatives of OpenAPI class DocumentedHandler #1150

Closed
RalphSteinhagen opened this issue Jan 21, 2021 · 3 comments

Comments

@RalphSteinhagen
Copy link
Contributor

By default Kotlin classes are final. would it be conceivable to open some of Javalin's classes, notably the class DocumentedHandler(...) in package io.javalin.plugin.openapi.dsl, to allow for further class extensions
or -- alternatively -- convert this to a public interface?

The specific use-case would be to provide a more meaningful source class implementation/package location information, for example, in the RouteOverviewPlugin, and other debugging cases by overwriting the toString() function:
image
(note the io.javalin.plugin.openapi.dsl.DocumentedHandler.class string that could hide any source implementation location).

This would help in debugging service implementations but also allow further user-specific custom extensions. Food for thought.

And as always: keep up the good work!

@MrThreepwood
Copy link
Contributor

I'm generally all for everything being open unless there's a strong reason not to. In fact, this is one of my primary complaints about Kotlin, I think sealed as default is a very poor choice. That said, it obviously does reduce the amount someone maintaining a library has to support.

I haven't yet had a use case for modifying the DocumentedHandler, but I am always for opening something.

@RalphSteinhagen
Copy link
Contributor Author

OK, I'll make a PR then.

@tipsy
Copy link
Member

tipsy commented Jan 28, 2021

Thanks @RalphSteinhagen ! There was no reason it was non-open (other than it being the default).

@tipsy tipsy closed this as completed Jan 28, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants