Skip to content

agilogy/json-comparator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

json-comparator

Build Status Coverage Status

A simple library to check a json document against an expected json pattern

Installation

resolvers += Resolver.url("Agilogy Scala",url("http://dl.bintray.com/agilogy/scala/"))(Resolver.ivyStylePatterns)

libraryDependencies += "com.agilogy" %% "json-comparator" % "1.0.0"

Usage

import com.agilogy.json.JsonComparator._

diff("""{"a":[1,...]}""", """{"a":[1]}""") 
// => Seq()

diff("""{"a":[1,...,2]}""", """{"a":[1,3,4]}""") 
// => Seq(Difference("/a[3]", Some(JsNumber(2)), None))


diff("""{"b": [...,{...},...,{"a":3},...]}""", """{"b": [{"a":3}]}""") 
// => Seq(Difference("/b[1]", Some(Json.obj("a" -> 3)), None))

TO-DO

  • Document it
  • Solve or document the weakness of ... inside strings in Json

Copyright

Copyright 2018 Agilogy

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

About

A simple library to check a json document against an expected json pattern

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages