LLMpediaThe first transparent, open encyclopedia generated by LLMs

jansson

Generated by GPT-5-mini
Note: This article was automatically generated by a large language model (LLM) from purely parametric knowledge (no retrieval). It may contain inaccuracies or hallucinations. This encyclopedia is part of a research project currently under review.
Article Genealogy
Parent: RapidJSON Hop 4
Expansion Funnel Raw 88 → Dedup 0 → NER 0 → Enqueued 0
1. Extracted88
2. After dedup0 (None)
3. After NER0 ()
4. Enqueued0 ()
jansson
NameJansson
TitleJansson
DeveloperMikael Sundell
Released2007
Latest release version2.14
Operating systemCross-platform
GenreLibrary
LicenseMIT License

jansson

Jansson is a C library for encoding, decoding, and manipulating JSON data. It provides a compact API for parsing, generating, and traversing JSON structures and is used in projects that interoperate with systems like Linux, FreeBSD, NetBSD, OpenBSD, macOS, and Windows. The library is integrated into many tooling ecosystems, including build systems and package managers such as Autotools, CMake, Debian, Fedora, Homebrew, and vcpkg.

Overview

Jansson implements a JSON parser and generator written in C (programming language), offering an API that maps JSON types to native C constructs. It emphasizes simplicity and small footprint suitable for embedding in applications like curl, systemd, nginx, postgresql, redis, and libreoffice. The library is often compared with other JSON libraries such as jansson alternative (note: placeholder), cJSON, RapidJSON, JSON-C, yajl, and jsmn in contexts where integration with projects like GCC, LLVM, GNOME, KDE, and Qt (software) is relevant.

History and Development

Development began in the mid-2000s by Mikael Sundell during work on projects interfacing with RESTful API services and data interchange with JavaScript, Python (programming language), Ruby (programming language), and Perl. Early adoption occurred in systems maintained by organizations such as Mozilla Foundation, Red Hat, Canonical (company), SUSE, and Oracle Corporation. Over time, contributions were made by developers affiliated with GitHub, GitLab, SourceForge, and large open-source initiatives including Debian Project and The FreeBSD Project. Release management has followed patterns seen in projects like Linux kernel and Glibc with semantic versioning and community-driven issue triage via platforms such as GitHub.

Features and Architecture

The library exposes functions to create, modify, and serialize JSON values corresponding to objects, arrays, strings, numbers, booleans, and null. Internally it uses reference counting similar to strategies used in GLib and memory management patterns familiar to developers of SQLite and OpenSSL. Parsing follows a streaming model comparable to YAJL while offering convenience functions akin to APIs in RapidJSON and cJSON. The architecture supports UTF-8 handling in line with recommendations from Unicode and integrates with internationalization systems used by GTK+ and Qt (software) applications. Error reporting and diagnostics are influenced by conventions in POSIX and ISO C standards, and build integration provides compatibility with toolchains like GCC, Clang, and Microsoft Visual C++

Usage and Examples

Typical usage patterns appear in server-side components for NGINX, client libraries for libcurl, and utilities packaged for distributions such as Ubuntu, CentOS, and Arch Linux. Common examples include parsing API responses from services like GitHub, Twitter, Stripe (company), and Google Cloud Platform; serializing configuration for systemd units or Docker images; and transforming payloads consumed by Node.js bridges or Python bindings. Code snippets demonstrate creating objects, appending arrays, and serializing to compact or pretty-printed output compatible with consumers such as Logstash, Elasticsearch, Kibana, Prometheus, and Grafana.

API and Bindings

Bindings and wrappers exist to expose functionality to higher-level languages including Python (programming language), Ruby (programming language), Lua (programming language), Perl, Haskell, Rust (programming language), Go (programming language), and Node.js. The C API is organized around functions for loading and dumping JSON, reference management, and type-specific accessors, comparable to interfaces offered by libxml2 and openssl libraries. Integration examples show use in projects leveraging build ecosystems like Autotools, CMake, and package repositories such as PyPI, Rubygems, and NPM.

Licensing and Distribution

The library is released under the MIT License, permitting use in both proprietary and open-source software, similar to licensing choices by projects such as SQLite and zlib. Distribution channels include source hosting on platforms like GitHub and packaged binaries in distributions maintained by Debian Project, Fedora Project, OpenBSD Project, and Homebrew. Corporate users and contributors follow contribution workflows akin to those in Linux Foundation projects, with issue tracking and pull requests processed through GitHub or GitLab repositories.

Category:JSON libraries