Jump to content

Connect SuperML | Leeroopedia MCP: Equip your AI agents with best practices, code verification, and debugging knowledge. Powered by Leeroo — building Organizational Superintelligence. Contact us at founders@leeroo.com.

Principle:Treeverse LakeFS Java SDK JSON Serialization

From Leeroopedia


Knowledge Sources
Domains Java_SDK, Serialization
Last Updated 2026-02-08 00:00 GMT

Overview

Serialization strategy for converting between Java model objects and JSON payloads in the lakeFS SDK.

Description

The JSON utility class manages Gson-based serialization and deserialization for all lakeFS API model objects. It handles type adapter registration, date/time formatting, and discriminator-based polymorphic deserialization to ensure correct mapping between JSON API responses and Java types.

Usage

This principle is applied internally by the SDK whenever API requests are serialized or responses are deserialized. It is transparent to SDK users but critical for correct data exchange.

Theoretical Basis

The pattern uses Google Gson with custom type adapters:

  1. A central Gson instance is configured with type adapters for all model classes.
  2. Date/time types use ISO 8601 formatters.
  3. Discriminator fields enable polymorphic deserialization.
  4. The configuration is immutable after initialization.

Related Pages

Page Connections

Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment