Closed Shuro closed 1 year ago
It is a soft dependency. Let me look into this right now
Ahh it's a weird interaction between the OpenAPI annotations and Vault. Still digging
OK this is because I changed the scope
of the Vault maven dependency to provided
as per its documentation. This was required to make all the RegisteredServiceProvider
parts work properly (see https://github.com/phybros/servertap/blob/main/src/main/java/io/servertap/PluginEntrypoint.java#L266).
But changing it to provided means that any time the Economy
class is accessed, it throws a NoClassDef exception if you don't "provide" the Jar. In this case the OpenAPI stuff is trying to look at the Economy API routes to find out what types are used (I think).
I think there's a solution to this, but it might take some work. Still looking
Ah yeah. It's due to the the OpenAPI code doing reflection on PluginEntryPoint which declares a private static field of type Economy
. I'll have to rewrite this a little bit to create a sort of wrapper around the eco stuff. Thank you for the bug report @Shuro
Looks like 3edc3f95f1a70d4ed15ef70c2b64db92088ba371 fixed the issue. Introduced a new wrapper around the economy instance and made it a singleton. Now only economy related functionality causes the Economy
class to be invoked/referenced.
I tested it with and without Vault and an eco plugin and swagger loads/works fine. In addition the economy routes also work fine. Seems good to me. I'll release this as a new version shortly.
Fixed in v0.4.0 https://github.com/phybros/servertap/releases/tag/v0.4.0
First off:
I got two exceptions while trying out the swagger on a custom port on servertap. First:
Can't read from file http://myserverip:9998/swagger-docs"
and exceptions in the console. I don't have the vault plugin, since I thought it is a soft-dependency: