awesome-repositories.com
Blog
awesome-repositories.com

Discover the best open-source repositories with AI-powered search.

ExploreCurated searchesOpen-source alternativesSelf-hosted softwareBlogSitemap
ProjectAboutHow we rankPressMCP server
LegalPrivacyTerms
© 2026 Bringes Technology SRL·VAT RO45896025·hello@awesome-repositories.com
·
square avatar

square/moshi

0
View on GitHub↗
10,138 stars·804 forks·Kotlin·Apache-2.0·7 viewssquare.github.io/moshi/1.x↗

Moshi

Moshi is a JSON serialization library and parser for Kotlin and Java. It functions as a reflectionless JSON encoder that converts typed objects to JSON strings and parses JSON data back into language objects.

The library distinguishes itself through compile-time adapter generation, which removes the performance overhead associated with runtime reflection. It also provides a polymorphic JSON mapper that uses type identifiers to resolve and instantiate specific subclasses of a common base type.

The framework supports custom adapter definitions for specialized type conversion, including nullability constraint enforcement and contextual encoding via qualifiers. Its mapping capabilities cover field renaming, enum fallback management, property exclusion, and value class inlining. Additionally, it provides low-level streaming tools for raw value processing and non-destructive token peeking.

Features

  • JSON Serialization Libraries - Functions as a high-performance library for converting Kotlin and Java objects to and from JSON.
  • Compile-Time Code Generation - Produces optimized serialization logic at compile time to eliminate the performance overhead of runtime reflection.
  • Custom Type Converters - Provides mechanisms to define specific logic for converting complex objects to control the resulting JSON string format.
  • JSON Converters - Provides a framework for defining custom converters to handle specialized type transformations during JSON serialization.
  • JSON-to-Model Mappers - Converts JSON strings into typed language objects by mapping keys to class fields.
  • Custom Field Mapping - Provides customization of object field mapping to JSON keys using annotations to bridge naming conventions.
  • JSON Parsers - Implements a JSON parser specifically optimized for Kotlin, supporting null safety and code generation.
  • Reflectionless Encoders - Provides a reflectionless encoding mechanism using compile-time generated adapters for maximum performance.
  • Type Safe Parsing - Ensures data integrity by mapping JSON input to strongly typed objects with strict nullability enforcement.
  • JSON Serialization - Parses classes, primitives, and collections into JSON strings and back using built-in or generated logic.
  • Adapter-Based Mapping - Implements a system of dedicated adapters to map JSON keys to class properties and vice versa.
  • Reflectionless Serialization - Uses compile-time adapter generation to eliminate the performance costs associated with runtime reflection.
  • Serialization Adapters - Provides modular components that encapsulate custom logic for converting specific data types during serialization.
  • Contextual Serialization Rules - Uses qualifiers to apply different encoding rules to the same data type based on the specific field context.
  • Data Parsing Utilities - Converts complex types like dates into standard objects using prebuilt adapters during the parsing process.
  • Polymorphic Mapping - Embeds type identifiers in the JSON to resolve and instantiate specific subclasses of a common base type.
  • Token-Based Stream Parsing - Reads JSON data as a sequence of tokens allowing for peek operations without consuming the underlying stream.
  • Compositional Wrappers - Wraps existing adapters in modifiers to add behavioral logic like null safety or data transformation.
  • Nullability Constraint Enforcement - Enables the creation of adapters that forbid nulls in the data body and fail immediately when encountered.
  • Contextual Encoding Qualifiers - Uses qualifiers to apply different encoding rules to the same data type based on the specific field context.
  • JSON Processing - Modern, unopinionated JSON library using standard Java types.
  • Android Development Utilities - Modern JSON library for Android and Java.
  • Data Serialization - Modern JSON library for Android and Java.

Star history

Star history chart for square/moshiStar history chart for square/moshi

AI search

Explore more awesome repositories

Describe what you need in plain English — the AI ranks thousands of curated open-source projects by relevance.

Start searching with AI

Open-source alternatives to Moshi

Similar open-source projects, ranked by how many features they share with Moshi.
  • fasterxml/jacksonFasterXML avatar

    FasterXML/jackson

    9,740View on GitHub↗

    Jackson is a Java data binding framework and multi-format data serializer used to translate data structures into native language objects. It functions as a JSON data binding library and a streaming parser that reads and writes data as discrete tokens to process large datasets with minimal memory. The project distinguishes itself through a bytecode serialization accelerator that replaces standard reflection with generated bytecode to increase data binding speed. It employs a module-based extensibility model to support a wide range of formats beyond JSON, including XML, YAML, CSV, TOML, and bin

    hacktoberfestjacksonjava-json
    View on GitHub↗9,740
  • google/gsongoogle avatar

    google/gson

    24,357View on GitHub↗

    Gson is a Java library designed for the serialization and deserialization of objects into structured text formats. It functions as a reflection-based data mapper, inspecting class structures at runtime to automatically convert memory-resident objects into data representations and reconstruct them back into typed language objects. The library distinguishes itself through a modular type-adapter pattern that allows for custom conversion rules for complex or nested structures. It also provides robust support for production environments by generating build-time metadata and configuration rules, wh

    Java
    View on GitHub↗24,357
  • ijl/orjsonijl avatar

    ijl/orjson

    8,110View on GitHub↗

    orjson is a high-performance Python library for serializing and deserializing JSON data. It functions as both a JSON parsing library and a serialization engine, converting data between native Python objects and UTF-8 encoded bytes. The project provides specialized support for converting complex Python data structures, including dataclasses, datetime objects, and NumPy arrays and scalars, into JSON format. It also allows for the insertion of pre-serialized JSON blobs into documents to maintain processing speed. The library includes capabilities for memory-efficient deserialization through key

    Pythondataclassesdatetimedeserialization
    View on GitHub↗8,110
  • alibaba/fastjsonalibaba avatar

    alibaba/fastjson

    25,625View on GitHub↗

    Fastjson is a Java data binding framework and serialization library designed to convert objects to JSON strings and parse JSON data into typed objects. It functions as a JSON parser and stream processor capable of transforming JSON strings into data structures. The project emphasizes high performance JSON processing and memory management, specifically through the use of a pipeline to stream oversized JSON objects and texts to prevent memory exhaustion. It provides capabilities for JSON data serialization and deserialization workflows, including custom JSON data mapping and the ability to def

    Java
    View on GitHub↗25,625
See all 30 alternatives to Moshi→

Frequently asked questions

What does square/moshi do?

Moshi is a JSON serialization library and parser for Kotlin and Java. It functions as a reflectionless JSON encoder that converts typed objects to JSON strings and parses JSON data back into language objects.

What are the main features of square/moshi?

The main features of square/moshi are: JSON Serialization Libraries, Compile-Time Code Generation, Custom Type Converters, JSON Converters, JSON-to-Model Mappers, Custom Field Mapping, JSON Parsers, Reflectionless Encoders.

What are some open-source alternatives to square/moshi?

Open-source alternatives to square/moshi include: fasterxml/jackson — Jackson is a Java data binding framework and multi-format data serializer used to translate data structures into… google/gson — Gson is a Java library designed for the serialization and deserialization of objects into structured text formats. It… ijl/orjson — orjson is a high-performance Python library for serializing and deserializing JSON data. It functions as both a JSON… alibaba/fastjson — Fastjson is a Java data binding framework and serialization library designed to convert objects to JSON strings and… alibaba/handyjson — HandyJSON is a Swift JSON serialization library and data mapper. It functions as an object mapper that converts JSON… codermjlee/mjextension — MJExtension is a JSON serialization library and model mapping framework used to convert data between JSON strings and…