Awesome Open Source
Awesome Open Source - Crank up the development of RESTful applications!

Build Status Gitter License Coverage Status maven-central

What is Crnk?

Crnk is an implementation of the JSON API specification and recommendations in Java to facilitate building RESTful applications. It provides many conventions and building blocks that application can benefit from. This includes features such as sorting, filtering, pagination, requesting complex object graphs, sparse field sets, attaching links to data or atomically execute multiple operations. Further integration with frameworks and libraries such as Spring, CDI, JPA, Bean Validation, Dropwizard, Servlet API, Zipkin and and more ensure that JSON API plays well together with the Java ecosystem. Have a look at and the documentation for more detailed information.

Release notes can be found in


Crnk Maven artifacts are available from jcenter/bintray:

Note that due to reliability issues of MavenCentral we only rarely publish there.


Crnk requires Java 1.8 or later and an SLF4J setup for logging.



Gradle settings.gradle can look like:

gradle.beforeProject { Project project ->
    project.with {
        buildscript {
            repositories {
                // maven { url '' }
        repositories {
            // maven { url '' }

and the build.gradle:

dependencies {
    implementation platform('io.crnk:crnk-bom:INSERT_VERSION_HERE')
    annotationProcessor platform('io.crnk:crnk-bom:INSERT_VERSION_HERE')

    annotationProcessor 'io.crnk:crnk-gen-java'

    implementation "io.crnk:crnk-setup-spring-boot2"
    implementation "io.crnk:crnk-data-jpa"
    implementation "io.crnk:crnk-data-facet"
    implementation "io.crnk:crnk-format-plain-json"
    implementation "io.crnk:crnk-validation"
    implementation "io.crnk:crnk-home"
    implementation "io.crnk:crnk-ui"
    implementation "io.crnk:crnk-operations"
    implementation "io.crnk:crnk-security"

and a basic Java example:

@JsonApiResource(type = "vote")
public class Vote {

    private UUID id;

    private int stars;


public class VoteRepository extends ResourceRepositoryBase<Vote, UUID> {

    public Map<UUID, Vote> votes = new ConcurrentHashMap<>();

    public VoteRepository() {

    public ResourceList<Vote> findAll(QuerySpec querySpec) {
        return querySpec.apply(votes.values());

    public <S extends Vote> S save(S entity) {
        votes.put(entity.getId(), entity);
        return null;

    public void delete(UUID id) {

or with JPA:

@JsonApiResource(type = "person")
public class PersonEntity {

	private UUID id;

	private String name;

	private int year;

	@OneToMany(mappedBy = "movie")
	private List<RoleEntity> roles = new ArrayList<>();

	private Integer version;

public class PersonRepository extends JpaEntityRepositoryBase<PersonEntity, UUID> {

	public PersonRepository() {

	public PersonEntity save(PersonEntity entity) {
		// add your save logic here

	public PersonEntity create(PersonEntity entity) {
		// add your create logic here
		return super.create(entity);

	public void delete(UUID id) {
		// add your save logic here

Crnk integrates well with many frameworks. Have a look at the documentation and carefully choose what you need. Don't hesitate to ask for help and suggest improvements!


Crnk is licensed under the Apache License, Version 2.0. You can grab a copy of the license at

Building from Source

Crnk make use of Gradle for its build. To build the complete project run

gradlew clean build

Note as part of the build a local Node installation is downloaded to build the frontend parts (crnk-ui) of the project.




We thank YourKit for supporting open source projects with profiler and monitoring tooling.

Related Awesome Lists
Top Programming Languages
Top Projects

Get A Weekly Email With Trending Projects For These Topics
No Spam. Unsubscribe easily at any time.
Java (396,490
Json (39,567
Rest (29,242
Rest Api (16,829
Spring Boot (16,052
Jpa (3,479
Json Api (2,301
Opentracing (713
Low Code (436
Jax Rs (358
Spring Data Rest (63