fm.finch:finch-json

It is a library designed to help you write easier null-safe code when you work with JSON

License

License

Categories

Categories

JSON Data
GroupId

GroupId

fm.finch
ArtifactId

ArtifactId

finch-json
Last Version

Last Version

1.0.0
Release Date

Release Date

Type

Type

jar
Description

Description

fm.finch:finch-json
It is a library designed to help you write easier null-safe code when you work with JSON
Project URL

Project URL

https://github.com/FinchMoscow/json
Source Code Management

Source Code Management

https://github.com/FinchMoscow/json/tree/master

Download finch-json

How to add to project

<!-- https://jarcasting.com/artifacts/fm.finch/finch-json/ -->
<dependency>
    <groupId>fm.finch</groupId>
    <artifactId>finch-json</artifactId>
    <version>1.0.0</version>
</dependency>
// https://jarcasting.com/artifacts/fm.finch/finch-json/
implementation 'fm.finch:finch-json:1.0.0'
// https://jarcasting.com/artifacts/fm.finch/finch-json/
implementation ("fm.finch:finch-json:1.0.0")
'fm.finch:finch-json:jar:1.0.0'
<dependency org="fm.finch" name="finch-json" rev="1.0.0">
  <artifact name="finch-json" type="jar" />
</dependency>
@Grapes(
@Grab(group='fm.finch', module='finch-json', version='1.0.0')
)
libraryDependencies += "fm.finch" % "finch-json" % "1.0.0"
[fm.finch/finch-json "1.0.0"]

Dependencies

compile (1)

Group / Artifact Type Version
org.springframework : spring-core Optional jar 5.2.5.RELEASE

provided (2)

Group / Artifact Type Version
org.projectlombok : lombok jar 1.18.12
com.fasterxml.jackson.core : jackson-databind jar 2.10.3

test (1)

Group / Artifact Type Version
junit : junit jar 4.13

Project Modules

There are no modules declared in this project.

FINCH JSON

Finch-Json is a library designed to help you write easier null-safe code. It simplifies the syntax and reduces the amount of code lines in your work.

How it works

It's just a wrapper around the Jackson library and it executes only Jackson's methods.

Usage:

Create or parse JSON:

var createJson = json()
      .set("name", "Ivan")
      .set("addresses", array()
        .add(json()
          .set("street", "Popov pr 1k1")
          .set("city", "Moscow")
        )
      );

var parseJson = Json.parse("{\"name\":"Ivan", \"address\":[{\"street\": \"Popov pr 1k1\"}]}");

Use with Spring

@PostMapping("/{entityId}")
public Json updateEntity(@PathVariable long entityId, @RequestBody Json data) { // data : {"updatedField": "new value"}
    var entity = repository.findById(entityId);
    data.updateObject(entity);
    repository.save(entity);      
}

License

Finch-Json is released under the MIT License.

Special Thanks

fm.finch

FINCH

Versions

Version
1.0.0