All Downloads are FREE. Search and download functionalities are using the official Maven repository.

uk.co.mruoc.jsonapi.ApiDocumentFactory Maven / Gradle / Ivy

Go to download

Library containing jackson module and classes to help building APIs that follow the json api spec in Java

There is a newer version: 2.0.16
Show newest version
package uk.co.mruoc.jsonapi;

import com.fasterxml.jackson.databind.JsonNode;

import java.io.IOException;
import java.util.Optional;

public interface ApiDocumentFactory {

    D build(final ApiDataDocumentRequest request) throws IOException;

    static Optional extractIdNode(final JsonNode dataNode) {
        return Optional.ofNullable(dataNode.get("id"));
    }

    static JsonNode extractTypeNode(final JsonNode dataNode) {
        return dataNode.get("type");
    }

    static JsonNode extractAttributesNode(final JsonNode dataNode) {
        return dataNode.get("attributes");
    }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy