Giter VIP home page Giter VIP logo

jsonurl-java's Introduction

JSON→URL

Apache License, Version 2.0, January 2004 Release javadoc GitHub Build Status Quality Gate Coverage Lines of Code Security Rating Vulnerabilities Maintainability Rating FOSSA Status Contributor Covenant Conventional Commits

json.org module: Known Vulnerabilities javadoc

javax.json module: Known Vulnerabilities javadoc

About

RFC8259 describes the JSON data model and interchange format, which is widely used in application-level protocols including RESTful APIs. It is common for applications to request resources via the HTTP POST method, with JSON entities. However, POST is suboptimal for requests which do not modify a resource's state. JSON→URL defines a text format for the JSON data model suitable for use within a URL/URI.

Usage

The factory artifact defines a generic JSON->URL parser and includes an implementation based Java SE data types (e.g. java.util.Map, java.util.List, etc). There are two additional modules, distributed as separate artifacts, which implement a parser based on JSR-374 and Douglas Crockford's Java API.

Java SE API example:

<dependencies>
  <dependency>
    <groupId>org.jsonurl</groupId>
    <artifactId>jsonurl-factory</artifactId>
    <version>${jsonurl.version}</version>
  </dependency>
</dependencies>
import java.util.Map;
import org.jsonurl.j2se.JsonUrlParser;

JsonUrlParser p = new JsonUrlParser();
Map obj = p.parseObject( "(Hello:World!)" );
System.out.println(obj.get("Hello")) // World!

Json.org example:

<dependencies>
  <dependency>
    <groupId>org.jsonurl</groupId>
    <artifactId>jsonurl-jsonorg</artifactId>
    <version>${jsonurl.version}</version>
  </dependency>
</dependencies>
import org.json.JSONObject;
import org.jsonurl.jsonorg.JsonUrlParser;

JsonUrlParser p = new JsonUrlParser();
JSONObject obj = p.parseObject( "(Hello:World!)" );
System.out.println(obj.get("Hello")) // World!

JSR-374 example:

<dependencies>
  <dependency>
    <groupId>org.jsonurl</groupId>
    <artifactId>jsonurl-jsr374</artifactId>
    <version>${jsonurl.version}</version>
  </dependency>
  <dependency>
    <groupId>org.glassfish</groupId>
    <artifactId>javax.json</artifactId>
    <version>${javax.json.version}</version>
  </dependency>
</dependencies>
import javax.json.JsonObject;
import org.jsonurl.jsonp.JsonUrlParser;

JsonUrlParser p = new JsonUrlParser();
JsonObject obj = p.parseObject( "(Hello:World!)" );
System.out.println(obj.get("Hello")) // World!

Javadocs

All artifacts published to Maven Central include sources and javadoc JARs. You can browse the current, and all previous revisions, via Javadoc.io:

Additionally, Javadocs are also generated automatically on pushes to main.

Security

The parser is designed to parse untrusted input. It supports limits on the number of parsed values and depth of nested arrays or objects. When the limit is exceeded a LimitException is thrown. Sane limit values are set by default.

License

FOSSA Status

jsonurl-java's People

Contributors

dmaccormack avatar jsonurl avatar snyk-bot avatar fossabot avatar

Watchers

James Cloos 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.