Open-Awesome
CategoriesAlternativesStacksSelf-HostedExplore
Open-Awesome

© 2026 Open-Awesome. Curated for the developer elite.

TermsPrivacyAboutGitHubRSS
  1. Home
  2. C/C++
  3. jsoncons

jsoncons

NOASSERTIONC++v1.9.0

A C++ header-only library for JSON and JSON-like data formats with support for JSON Schema, JSONPath, CBOR, MessagePack, and more.

Visit WebsiteGitHubGitHub
853 stars209 forks0 contributors

What is jsoncons?

jsoncons is a C++ header-only library for constructing, parsing, and serializing JSON and JSON-like binary formats such as CBOR, MessagePack, and BSON. It solves the need for a high-performance, memory-efficient JSON library in C++ that also supports advanced features like JSON Schema validation, JSONPath queries, and strong typing via reflection.

Target Audience

C++ developers working with JSON data, especially those needing support for multiple data formats, large text processing, or integration with binary protocols like CBOR and MessagePack.

Value Proposition

Developers choose jsoncons for its comprehensive feature set, header-only design, and efficiency with large datasets. It uniquely combines JSON and binary format support with advanced querying and validation tools in a single library.

Overview

A C++, header-only library for constructing JSON and JSON-like data formats, with JSON Pointer, JSON Patch, JSON Schema, JSONPath, JMESPath, CSV, MessagePack, CBOR, BSON, UBJSON, toon-format

Use Cases

Best For

  • Parsing and generating large JSON texts efficiently in C++
  • Working with binary JSON-like formats such as CBOR or MessagePack
  • Implementing JSON Schema validation in C++ applications
  • Querying JSON data with JSONPath or JMESPath expressions
  • Converting between CSV and JSON formats
  • Building C++ applications that require strong typing for JSON data

Not Ideal For

  • Projects requiring only basic JSON parsing without support for binary formats or advanced queries
  • Embedded systems with strict memory constraints, as the library's extensive features may introduce overhead
  • Teams using compilers without C++11 support, since jsoncons mandates modern C++ standards
  • Applications where exceptions are disabled or error handling must avoid exception-based mechanisms

Pros & Cons

Pros

Broad Format Support

Handles JSON, CBOR, MessagePack, BSON, and more through extensions, enabling seamless multi-format data processing in a single library.

Efficient Large-Text Processing

Designed for high performance with very large JSON texts using cursor-level access for StAX-style pull parsing, ideal for streaming applications.

Strong Typing via Reflection

Supports mapping JSON to C++ structures with reflection traits, enabling type-safe serialization and deserialization without manual parsing.

Advanced Query Capabilities

Implements JSONPath, JMESPath, JSON Pointer, and JSON Patch, providing robust tools for querying and transforming JSON data directly in C++.

Cons

Steep Learning Curve

The API offers multiple usage modes (variant-like, strongly-typed, cursor-level), which can be overwhelming for developers needing only simple JSON operations.

Deprecation Management Overhead

The library includes deprecated names that require macro definitions like JSONCONS_NO_DEPRECATED to suppress, adding complexity for new code to avoid breaking changes.

Exception-Dependent Error Handling

Relies heavily on exceptions for error reporting; disabling them via JSONCONS_NO_EXCEPTIONS leads to std::terminate calls, which may not suit all environments.

Frequently Asked Questions

Quick Stats

Stars853
Forks209
Contributors0
Open Issues16
Last commit7 days ago
CreatedSince 2013

Tags

#json-pointer#data-serialization#jsonpath#cbor#c-plus-plus#json-schema#json-patch#json-serialization#csv#json-diff#json-library#json#messagepack#cpp#header-only

Built With

C
C++11
C
CMake

Links & Resources

Website

Included in

C/C++70.6k
Auto-fetched 1 day ago

Related Projects

JSON for Modern C++JSON for Modern C++

JSON for Modern C++

Stars50,413
Forks7,469
Last commit1 day ago
simdjsonsimdjson

Parsing gigabytes of JSON per second : used by Facebook/Meta Velox, the Node.js runtime, ClickHouse, WatermelonDB, Apache Doris, Milvus, StarRocks

Stars24,164
Forks1,274
Last commit1 day ago
RapidJSONRapidJSON

A fast JSON parser/generator for C++ with both SAX/DOM style API

Stars15,114
Forks3,648
Last commit1 year ago
cJSONcJSON

Ultralightweight JSON parser in ANSI C

Stars12,930
Forks3,516
Last commit4 months ago
Community-curated · Updated weekly · 100% open source

Found a gem we're missing?

Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.

Submit a projectStar on GitHub