# skyscreamer/JSONassert

Write JSON unit tests in less code. Great for testing REST interfaces.

Repository: https://github.com/skyscreamer/JSONassert
Canonical: https://ross.abutalabs.com/products/jsonassert
Homepage: http://jsonassert.skyscreamer.org
Language: Java
License: Apache-2.0
License Family: permissive
Last push: 2024-07-28T18:03:56+00:00

## Health v2 (maintenance only)
Score: 23/100 (v2, computed 2026-09-03T02:20:16.233290+00:00)
- activity 0, release rhythm 8, longevity 100
- inputs: {"age_days": 5327, "days_push": 766, "days_rel": null, "gap_med": null, "n_releases_24m": 0}
- flags: none
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 1056, forks 204 (observed 2026-08-28T04:03:24.539314+00:00)

## What it is
A Java library for writing JSON unit tests with minimal code, comparing JSON strings by logical structure and data. It integrates with JUnit and offers a lenient mode that tolerates array reordering and extra fields, making REST API tests less brittle.

## Use cases
- assert JSON responses in JUnit tests
- test REST API endpoints return expected JSON
- compare JSON structures ignoring field order
- write less brittle JSON assertions
- get readable diffs for JSON test failures
- enforce strict JSON equality when needed

## When to choose
- you're testing Java/JVM services that return JSON
- you want concise, readable JSON assertions in JUnit
- you need lenient comparison that tolerates ordering and extra fields
- you want clear error messages pinpointing JSON differences

## When to avoid
- you're not on the JVM (Java/Kotlin/Scala)
- you need JSON Schema validation rather than value comparison
- you need to compare very large JSON documents with performance constraints
- you need non-JSON formats like XML or YAML

## Facets
- artifact type: library
- maturity: maintenance
- function: testing, json, serialization
- domain: testing, developer-tools, apis, web-development
- platform: jvm, cli
- tags: json-assertions, junit, rest-testing, test-assertions

## Member repositories
- skyscreamer/JSONassert (main) score 23

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:03:24.539314+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-30T06:58:25.226358+00:00, confidence not recorded.
  - readme: https://github.com/skyscreamer/JSONassert (fetched 2026-08-28T04:03:24.539314+00:00, sha 0ef9e707400c)
  - homepage: http://jsonassert.skyscreamer.org (fetched 2026-08-29T12:59:56.112211+00:00, sha bd9d03d0f7d2)
  - site_page: https://jsonassert.skyscreamer.org/quickstart.html (fetched 2026-08-29T12:59:56.114840+00:00, sha 87356283a0b2)
  - site_page: https://jsonassert.skyscreamer.org/apidocs/index.html (fetched 2026-08-29T12:59:56.116603+00:00, sha 52c0a42f283f)
- Data as of 2026-08-30T08:39:29.467469+00:00.
