A Go utility for parsing, creating, and editing dynamic or unknown JSON structures with a simple wrapper around encoding/json.
Gabs is a Go library that simplifies working with dynamic or unknown JSON structures. It provides a convenient wrapper around Go's standard encoding/json package, making it easier to navigate, modify, and generate JSON without complex type assertions. It reduces boilerplate when dealing with dynamic JSON by adding minimal, pragmatic helper methods.
Go developers who need to parse, generate, or manipulate JSON data with flexible or unknown schemas, such as those working with APIs, configuration files, or data processing pipelines. It's particularly useful for scenarios where static struct definitions are impractical.
Developers choose Gabs because it offers a simple, chainable API for JSON manipulation that stays close to Go's standard library while adding convenience features like dot-path navigation, JSON merging, and programmatic generation. Its minimal design avoids unnecessary complexity, making it a pragmatic choice over more heavyweight alternatives.
For parsing, creating and editing unknown or dynamic JSON in Go
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Supports dot-path notation (Path), multi-argument search (Search), and JSON pointers (JSONPointer) for easy access to nested data, as shown in the parsing examples.
Provides methods like Set, ArrayAppend, and ArrayOfSize that can be chained for programmatic JSON generation and editing, demonstrated in the generation examples.
Can merge two JSON containers with collisions automatically converted into arrays, useful for combining data without manual handling.
Offers ChildrenMap() for objects and Children() for arrays, simplifying iteration over dynamic structures, as illustrated in the iteration examples.
By default, all numbers are parsed as float64, requiring extra steps like json.Decoder with UseNumber() for integers, which adds complexity.
Lacks built-in JSON schema validation or advanced error handling, making it less suitable for applications requiring robust data integrity checks.
Relies on map[string]interface{} for dynamic handling, which can be memory-intensive and slower for large or deeply nested JSON compared to static typing.