Jolt.Net
1.0.0
See the version list below for details.
dotnet add package Jolt.Net --version 1.0.0
NuGet\Install-Package Jolt.Net -Version 1.0.0
<PackageReference Include="Jolt.Net" Version="1.0.0" />
paket add Jolt.Net --version 1.0.0
#r "nuget: Jolt.Net, 1.0.0"
// Install Jolt.Net as a Cake Addin #addin nuget:?package=Jolt.Net&version=1.0.0 // Install Jolt.Net as a Cake Tool #tool nuget:?package=Jolt.Net&version=1.0.0
Jolt.Net
JSON to JSON transformation library written in c# where the "specification" for the transform is itself a JSON document. This is a c# port of the original Java version from https://github.com/bazaarvoice/jolt. JSON handling is provided by Newtonsoft Json
Useful For
- Transforming JSON data from ElasticSearch, MongoDb, Cassandra, etc before sending it off to the world
- Extracting data from a large JSON documents for your own consumption
Overview
Jolt :
- provides a set of transforms, that can be "chained" together to form the overall JSON to JSON transform.
- focuses on transforming the structure of your JSON data, not manipulating specific values
- The idea being: use Jolt to get most of the structure right, then write code to fix values
- consumes and produces Newtonsoft.Json objects (JToken, JArray, JObject, ...)
Stock Transforms
The Stock transforms are:
shift : copy data from the input tree and put it the output tree
default : apply default values to the tree
remove : remove data from the tree
sort : sort the Map key values alphabetically ( for debugging and human readability )
cardinality : "fix" the cardinality of input data. Eg, the "urls" element is usually a List, but if there is only one, then it is a String
Each transform has it's own DSL (Domain Specific Language) in order to facilitate it's narrow job.
Currently, all the Stock transforms just effect the "structure" of the data. To do data manipulation, you will need to write c# code. If you write your c# "data manipulation" code to implement the Transform interface, then you can insert your code in the transform chain.
The out-of-the-box Jolt transforms should be able to do most of your structural transformation, with custom c# implementing your data manipulation.
Documentation
Jolt Slide Deck : covers motivation, development, and transforms.
Javadoc explaining each transform DSL :
- shift
- default
- remove
- cardinality
- sort
- fully qualified c# type name: Class implements the ITransform or IContextualTransform interfaces, and can optionally be SpecDriven (abstract base class)
- Transform interface
- SpecDriven
- where the "input" is the JSON data as a JToken
Running a Jolt transform means creating an instance of Chainr with a list of transforms.
The JSON spec for Chainr looks like : unit test.
The c# side looks like :
var json = JObject.Parse(File.ReadAllText("/path/to/chainr/spec.json"));
var output = chainr.Transform(input);
return output;
Demo
There is a demo available at jolt-demo.appspot.com. You can paste in JSON input data and a Spec, and it will post the data to server and run the transform.
Note
- it is hosted on a free Google App Engine instance, so it may take a minute to spin up.
- it validates in input JSON and spec client side.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. |
.NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
.NET Standard | netstandard2.0 is compatible. netstandard2.1 was computed. |
.NET Framework | net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
MonoAndroid | monoandroid was computed. |
MonoMac | monomac was computed. |
MonoTouch | monotouch was computed. |
Tizen | tizen40 was computed. tizen60 was computed. |
Xamarin.iOS | xamarinios was computed. |
Xamarin.Mac | xamarinmac was computed. |
Xamarin.TVOS | xamarintvos was computed. |
Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETStandard 2.0
- Newtonsoft.Json (>= 12.0.2)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on Jolt.Net:
Package | Downloads |
---|---|
Mavanmanen.Apollo.Orchestration
Package Description |
GitHub repositories
This package is not used by any popular GitHub repositories.