An open API service indexing awesome lists of open source software.

https://github.com/hertzsprung/hamcrest-json

Hamcrest matchers for comparing JSON documents
https://github.com/hertzsprung/hamcrest-json

Last synced: 9 days ago
JSON representation

Hamcrest matchers for comparing JSON documents

Awesome Lists containing this project

README

        

Hamcrest matchers for comparing JSON documents, backed by the [JSONassert library](https://github.com/skyscreamer/JSONassert). The code is released under the [MIT license](http://www.opensource.org/licenses/mit-license.php).
Supports Java 8 or later.

Installation
============

To install from Maven Central:

```xml

uk.co.datumedge
hamcrest-json
0.2

```

Usage
=====
```java
import static uk.co.datumedge.hamcrest.json.SameJSONAs.*;

assertThat(
"{\"age\":43, \"friend_ids\":[16, 52, 23]}",
sameJSONAs("{\"friend_ids\":[52, 23, 16]}")
.allowingExtraUnexpectedFields()
.allowingAnyArrayOrdering());
```

Resources
=========
* [hamcrest-json website](https://www.datumedge.co.uk/hamcrest-json/)
* [API documentation](https://www.datumedge.co.uk/hamcrest-json/apidocs/index.html)