Giter VIP home page Giter VIP logo

jsonpath-syntax-validator's Introduction

JSON Path expression syntax validation

This project uses the JSON Path expression parsing logic mentioned in Stefan Goessner's article. I make use of parts of the code from original JSON path implementation in JS found here.

Usage

class Example {
    public static void main(String[] args) {
        JsonPathValidator validator = new BasicJsonPathValidator();
        Assert.assertTrue(validator.validate("$.as[?(@.name == 'samba')]"));
        Assert.assertFalse(validator.validate("a['??kangaroo   \"A\"'][??(@.name == 'a')].value"));        
    } 
}

JsonPathValidator is an interface that has a basic implementation BasicJsonPathValidator. If required other sophisticated validators can be added to this library.

Note: This library doesn't really evaluate the path against a JSON object, this is strictly pre-evaluation phase syntax check.

Dependencies

  • Project Lombok
  • Maven
  • Slf4j
  • Logback

References

[1] https://goessner.net/articles/JsonPath/

[2] https://code.google.com/archive/p/jsonpath/

jsonpath-syntax-validator's People

Contributors

dependabot[bot] avatar sidmishraw avatar

Stargazers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.