2.7.20180622123244

Version: 2.7.20180622123244

Documentation (pdf)

The 2.7 release focuses on various usability improvements. Some further updates will be released in the coming weeks.

Patch Release 22. June

Number/size-based paging support

NumberSizePagingBehavior and NumberSizePagingSpec are new implementations that bring support for number/size-based paging instead of the default offset/limit paging. An example looks like:
	GET /tasks?page[number]=1&page[size]=10
For more information see here.

Refined paging support

@JsonApiResource.pagingSpec is introduced to provide more flexibility for paging. With this it deprecated the former @JsonApiResource.pagingBehavior. Motivation is to avoid coupling resources to a given paging implementation. This in turn allows, for example, the newly introduced number/size-based paging to be interoperable with existing offset/limit-based repositories. For more information see here.

Filtering by null

	GET /tasks?filter[name]=null
is now supported out-of-the-box.

Property to specify default include lookup behavior

A new property crnk.config.lookup.behavior.default specified the default include lookup behavior for relationships. Possible values are NONE, AUTOMATICALLY_WHEN_NULL and AUTOMATICALLY_ALWAYS.

Patch Release 14. June

WARN log message in case of security misconfigurations

A WARN message is written to the log if the security module or any other kind of resource filter hides all repositories from a user upon a request. Most likely the security module is not properly configured in such cases. If a user should not have access to any repositories, the authentication layer should entirely block him.

WARN log message when using wrong content type

A WARN message is written to the log if a PATCH or POST request is attempted to a JSON API repository with a content type other than application/vnd.api+json. Crnk does not serve such requests and will return a 404. The log message will let developer know what is wrong.

Minimal Spring Boot example application

spring-boot-minimal-example is a new example application that shows a very minimal setup just based on auto configuration and a single repository.

Spring Boot 2 upgrade

The example applications have been upgraded to Spring Boot 2. Spring Boot 1.x continues to be supported.

PATCH method can return 204 status code

If a repository returns a null upon a PATCH request, it will result in a HTTP 204 status code without contents. But keep in mind that POST requests must always return a resource.

Default paging fix for crnk-jpa

The customizable paging behavior introduced in the previous release led to an issue with JPA repositories ignoring the default paging limit.

Initial Release 8. June

use of Jackson to parse filter parameters

The TypeParser now also makes use of Jackson to deserialize parameters (next to already built-in and custom parsers). The behavior can also be disabled by setting:
 TypeParser.setUseJackson(false).

INFO log message on startup

that summarizes the setup of Crnk.
09:24:37 INFO  [ost-startStop-1] [    io.crnk.core.boot.CrnkBoot] crnk initialized: numResources=26, usedModules=[jackson, servlet, home, jpa, meta, operations, spring.mvc, ui, validation], securityProviders=[ServletSecurityProvider], pagingBehaviors=[OffsetLimitPagingBehavior], urlMapper=UrlMapperAdapter, serviceDiscovery=SpringServiceDiscovery

CDIServiceDiscovery backs-off in non-CDI environments

The CDIServiceDiscovery of crnk-cdi no longer fails if no CDI context is available. Instead an ERROR is added to the LOG.

QuerySpec mapping support JPA/DTO mapping

The JpaMapper interface has a new (default) method to map DTO-based QuerySpec to Entity-based QuerySpec instances:
default QuerySpec unmapQuerySpec(QuerySpec querySpec) {
	return querySpec;
}
It can be used to map filter, inclusion and sort parameters in the same fashion as the DTO/entitiy objects themselves.

Multiple SecurityProviders

Modules can now register multiple SecurityProvider providing roles to users.

Simplified Typescript Generation

The configuration of the Typescript generation has been stream-lined:
typescriptGen{
	runtime {
		...
	}

	npm {
		// map given Java package to a subdirectory of genDir
		directoryMapping['io.myapp.types'] = '/types'

		// map a given package to a third-party library
		packageMapping['io.other.app'] = '@other/app'
	}

	...
}

Along the way support to generate complete NPM packages has been deprecated since it has been rarely used and typically application may want to setup a custom NPM package anyway. For more information see here.

Hardened URL computation for crnk-servlet

The CrnkServlet can be integrated into many different environments, but not all of them behave exactly the same. Sometimes this could lead to a broken URL computation that needed to be fixed/overridden manually. The revised implementation is more robust against missing slashes and allow to override a broken servlet path with the crnk.config.web.path.prefix property or CrnkBoot.setWebPathPrefix(...).

Lazy Initialization of CrnkClient

CrnkClient performs more of its initialization in a lazy fashion (in CrnkClient.init). This allows to reconfigure more aspects of CrnkClient, such as paging behavior and service discovery.