Important: This news article covers an old version of Javalin (v3.12.0). The current version is v6.3.0.
See the documentation page for up-to-date information.

Non sub-path wildcards

Javalin has always supported wildcard routing with /path/*. As of 3.12.0, there’s also support for doing /path* and /path/:param*, which will match both /path+/path/* and /path/:param+/path/:param/* respectively. This is particularly useful when you want to run a before/after handler for a resource (and all sub-paths of the resource).

Pathless calls to crud() in ApiBuilder

You can now call crud() without a path argument, similar to the other methods in the ApiBuilder. This means you can finally use crud(MyHandler) inside a path() call.

You can now configure alias checking for resolving symlinks for static files. This can be done through a ContextHandler.AliasCheck field, which can be configure on config.aliasCheckForStaticFiles:

config.aliasCheckForStaticFiles = ContextHandler.AliasCheck { path, resource ->
    /* Your predicate here */
}

To allow all aliases, you can do config.aliasCheckForStaticFiles = new ContextHandler.ApproveAliases();

Thanks to sealedtx for implementing this.

Redoc configuration

LeoColman has created a fully typed API for configuring Redoc in the OpenAPI plugin, big thanks!

.reDoc(ReDocOptions("/redoc", RedocOptionsObject(
    hideDownloadButton = true,
    theme = RedocOptionsTheme(
        spacingUnit = 10,
        isTypographyOptimizeSpeed = true
    )
))

Misc fixes

  • The OpenAPI plugin now skips exampleSetFlag on serialization (thanks to pawel-piecyk)
  • Fixed issues with enums in OpenAPI plugin (thanks to sealedtx)
  • Fixed a bug in ignoreTrailingSlashes (thanks to NPi2Loup)
  • Context#body is now a lazy property (thanks to ghn1712)
  • The static instance in ApiBuilder is now thread-local (thanks to kwbc)