You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@johnzon.apache.org by sa...@apache.org on 2014/09/11 20:29:19 UTC

[03/22] renamed fleece to johnzon

http://git-wip-us.apache.org/repos/asf/incubator-johnzon/blob/6e86a53e/johnzon-core/src/test/resources/bench/medium_11kb.json
----------------------------------------------------------------------
diff --git a/johnzon-core/src/test/resources/bench/medium_11kb.json b/johnzon-core/src/test/resources/bench/medium_11kb.json
new file mode 100644
index 0000000..ba8aafd
--- /dev/null
+++ b/johnzon-core/src/test/resources/bench/medium_11kb.json
@@ -0,0 +1,443 @@
+{
+	"special-0":"\\f\n\r\t\uffff",
+	"unicode-\u0000- 0":"\u5656",
+	"bigdecimal0":7817265.00000111,
+	"bigdecimal-2-0":127655512123456.761009E-123,
+	"string-0":"lorem ipsum, ÄÖÜäöü.-,<!$%&/()9876543XXddddJJJJJJhhhhhhhh",
+	"int0":4561,
+	"ints0":0,
+	"false0":false,
+	"nil0":false,
+	"n0":      null                ,
+	"obj0":
+		{
+			"special-0":"\\f\n\r\t\uffff",
+			"unicode-\u0000- 0":"\u5656",
+	"bigdecimal0":7817265.00000111,
+			"bigdecimal-2-0":127655512123456.761009E-123,
+			"string-0":"lorem ipsum, ÄÖÜäöü.-,<!$%&/()9876543XXddddJJJJJJhhhhhhhh",
+			"int0":4561,
+			"ints0":0,
+			"false0":false,
+			"nil0":false,
+			"obj0":      null                ,
+			"obj0":
+				[    true    ,
+				{
+				"special-0":"\\f\n\r\t\uffff",
+				"unicode-\u0000- 0":"\u5656",
+				"bigdecimal0":7817265.00000111,
+				"bigdecimal-2-0":127655512123456.761009E-123,
+				"string-0":"lorem ipsum, ÄÖÜäöü.-,<!$%&/()9876543XXddddJJJJJJhhhhhhhh",
+				"int0":4561,
+				"ints0":0,
+				"false0":false,
+				"nil0":false,
+				"obj0":      null                
+				
+}
+			]
+		
+}
+
+
+
+                 	
                                                      ,
+	"special-1":"\\f\n\r\t\uffff",
+	"unicode-\u0000- 1":"\u5656",
+	"bigdecimal1":7817265.00000111,
+	"bigdecimal-2-1":127655512123456.761009E-123,
+	"string-1":"lorem ipsum, ÄÖÜäöü.-,<!$%&/()9876543XXddddJJJJJJhhhhhhhh",
+	"int1":4561,
+	"ints1":0,
+	"false1":false,
+	"nil1":false,
+	"n1":      null                ,
+	"obj1":
+		{
+			"special-1":"\\f\n\r\t\uffff",
+			"unicode-\u0000- 1":"\u5656",
+	"bigdecimal1":7817265.00000111,
+			"bigdecimal-2-1":127655512123456.761009E-123,
+			"string-1":"lorem ipsum, ÄÖÜäöü.-,<!$%&/()9876543XXddddJJJJJJhhhhhhhh",
+			"int1":4561,
+			"ints1":0,
+			"false1":false,
+			"nil1":false,
+			"obj1":      null                ,
+			"obj1":
+				[    true    ,
+				{
+				"special-1":"\\f\n\r\t\uffff",
+				"unicode-\u0000- 1":"\u5656",
+				"bigdecimal1":7817265.00000111,
+				"bigdecimal-2-1":127655512123456.761009E-123,
+				"string-1":"lorem ipsum, ÄÖÜäöü.-,<!$%&/()9876543XXddddJJJJJJhhhhhhhh",
+				"int1":4561,
+				"ints1":0,
+				"false1":false,
+				"nil1":false,
+				"obj1":      null                
+				
+}
+			]
+		
+}
+
+
+
+                 	
                                                      ,
+	"special-2":"\\f\n\r\t\uffff",
+	"unicode-\u0000- 2":"\u5656",
+	"bigdecimal2":7817265.00000111,
+	"bigdecimal-2-2":127655512123456.761009E-123,
+	"string-2":"lorem ipsum, ÄÖÜäöü.-,<!$%&/()9876543XXddddJJJJJJhhhhhhhh",
+	"int2":4561,
+	"ints2":0,
+	"false2":false,
+	"nil2":false,
+	"n2":      null                ,
+	"obj2":
+		{
+			"special-2":"\\f\n\r\t\uffff",
+			"unicode-\u0000- 2":"\u5656",
+	"bigdecimal2":7817265.00000111,
+			"bigdecimal-2-2":127655512123456.761009E-123,
+			"string-2":"lorem ipsum, ÄÖÜäöü.-,<!$%&/()9876543XXddddJJJJJJhhhhhhhh",
+			"int2":4561,
+			"ints2":0,
+			"false2":false,
+			"nil2":false,
+			"obj2":      null                ,
+			"obj2":
+				[    true    ,
+				{
+				"special-2":"\\f\n\r\t\uffff",
+				"unicode-\u0000- 2":"\u5656",
+				"bigdecimal2":7817265.00000111,
+				"bigdecimal-2-2":127655512123456.761009E-123,
+				"string-2":"lorem ipsum, ÄÖÜäöü.-,<!$%&/()9876543XXddddJJJJJJhhhhhhhh",
+				"int2":4561,
+				"ints2":0,
+				"false2":false,
+				"nil2":false,
+				"obj2":      null                
+				
+}
+			]
+		
+}
+
+
+
+                 	
                                                      ,
+	"special-3":"\\f\n\r\t\uffff",
+	"unicode-\u0000- 3":"\u5656",
+	"bigdecimal3":7817265.00000111,
+	"bigdecimal-2-3":127655512123456.761009E-123,
+	"string-3":"lorem ipsum, ÄÖÜäöü.-,<!$%&/()9876543XXddddJJJJJJhhhhhhhh",
+	"int3":4561,
+	"ints3":0,
+	"false3":false,
+	"nil3":false,
+	"n3":      null                ,
+	"obj3":
+		{
+			"special-3":"\\f\n\r\t\uffff",
+			"unicode-\u0000- 3":"\u5656",
+	"bigdecimal3":7817265.00000111,
+			"bigdecimal-2-3":127655512123456.761009E-123,
+			"string-3":"lorem ipsum, ÄÖÜäöü.-,<!$%&/()9876543XXddddJJJJJJhhhhhhhh",
+			"int3":4561,
+			"ints3":0,
+			"false3":false,
+			"nil3":false,
+			"obj3":      null                ,
+			"obj3":
+				[    true    ,
+				{
+				"special-3":"\\f\n\r\t\uffff",
+				"unicode-\u0000- 3":"\u5656",
+				"bigdecimal3":7817265.00000111,
+				"bigdecimal-2-3":127655512123456.761009E-123,
+				"string-3":"lorem ipsum, ÄÖÜäöü.-,<!$%&/()9876543XXddddJJJJJJhhhhhhhh",
+				"int3":4561,
+				"ints3":0,
+				"false3":false,
+				"nil3":false,
+				"obj3":      null                
+				
+}
+			]
+		
+}
+
+
+
+                 	
                                                      ,
+	"special-4":"\\f\n\r\t\uffff",
+	"unicode-\u0000- 4":"\u5656",
+	"bigdecimal4":7817265.00000111,
+	"bigdecimal-2-4":127655512123456.761009E-123,
+	"string-4":"lorem ipsum, ÄÖÜäöü.-,<!$%&/()9876543XXddddJJJJJJhhhhhhhh",
+	"int4":4561,
+	"ints4":0,
+	"false4":false,
+	"nil4":false,
+	"n4":      null                ,
+	"obj4":
+		{
+			"special-4":"\\f\n\r\t\uffff",
+			"unicode-\u0000- 4":"\u5656",
+	"bigdecimal4":7817265.00000111,
+			"bigdecimal-2-4":127655512123456.761009E-123,
+			"string-4":"lorem ipsum, ÄÖÜäöü.-,<!$%&/()9876543XXddddJJJJJJhhhhhhhh",
+			"int4":4561,
+			"ints4":0,
+			"false4":false,
+			"nil4":false,
+			"obj4":      null                ,
+			"obj4":
+				[    true    ,
+				{
+				"special-4":"\\f\n\r\t\uffff",
+				"unicode-\u0000- 4":"\u5656",
+				"bigdecimal4":7817265.00000111,
+				"bigdecimal-2-4":127655512123456.761009E-123,
+				"string-4":"lorem ipsum, ÄÖÜäöü.-,<!$%&/()9876543XXddddJJJJJJhhhhhhhh",
+				"int4":4561,
+				"ints4":0,
+				"false4":false,
+				"nil4":false,
+				"obj4":      null                
+				
+}
+			]
+		
+}
+
+
+
+                 	
                                                      ,
+	"special-5":"\\f\n\r\t\uffff",
+	"unicode-\u0000- 5":"\u5656",
+	"bigdecimal5":7817265.00000111,
+	"bigdecimal-2-5":127655512123456.761009E-123,
+	"string-5":"lorem ipsum, ÄÖÜäöü.-,<!$%&/()9876543XXddddJJJJJJhhhhhhhh",
+	"int5":4561,
+	"ints5":0,
+	"false5":false,
+	"nil5":false,
+	"n5":      null                ,
+	"obj5":
+		{
+			"special-5":"\\f\n\r\t\uffff",
+			"unicode-\u0000- 5":"\u5656",
+	"bigdecimal5":7817265.00000111,
+			"bigdecimal-2-5":127655512123456.761009E-123,
+			"string-5":"lorem ipsum, ÄÖÜäöü.-,<!$%&/()9876543XXddddJJJJJJhhhhhhhh",
+			"int5":4561,
+			"ints5":0,
+			"false5":false,
+			"nil5":false,
+			"obj5":      null                ,
+			"obj5":
+				[    true    ,
+				{
+				"special-5":"\\f\n\r\t\uffff",
+				"unicode-\u0000- 5":"\u5656",
+				"bigdecimal5":7817265.00000111,
+				"bigdecimal-2-5":127655512123456.761009E-123,
+				"string-5":"lorem ipsum, ÄÖÜäöü.-,<!$%&/()9876543XXddddJJJJJJhhhhhhhh",
+				"int5":4561,
+				"ints5":0,
+				"false5":false,
+				"nil5":false,
+				"obj5":      null                
+				
+}
+			]
+		
+}
+
+
+
+                 	
                                                      ,
+	"special-6":"\\f\n\r\t\uffff",
+	"unicode-\u0000- 6":"\u5656",
+	"bigdecimal6":7817265.00000111,
+	"bigdecimal-2-6":127655512123456.761009E-123,
+	"string-6":"lorem ipsum, ÄÖÜäöü.-,<!$%&/()9876543XXddddJJJJJJhhhhhhhh",
+	"int6":4561,
+	"ints6":0,
+	"false6":false,
+	"nil6":false,
+	"n6":      null                ,
+	"obj6":
+		{
+			"special-6":"\\f\n\r\t\uffff",
+			"unicode-\u0000- 6":"\u5656",
+	"bigdecimal6":7817265.00000111,
+			"bigdecimal-2-6":127655512123456.761009E-123,
+			"string-6":"lorem ipsum, ÄÖÜäöü.-,<!$%&/()9876543XXddddJJJJJJhhhhhhhh",
+			"int6":4561,
+			"ints6":0,
+			"false6":false,
+			"nil6":false,
+			"obj6":      null                ,
+			"obj6":
+				[    true    ,
+				{
+				"special-6":"\\f\n\r\t\uffff",
+				"unicode-\u0000- 6":"\u5656",
+				"bigdecimal6":7817265.00000111,
+				"bigdecimal-2-6":127655512123456.761009E-123,
+				"string-6":"lorem ipsum, ÄÖÜäöü.-,<!$%&/()9876543XXddddJJJJJJhhhhhhhh",
+				"int6":4561,
+				"ints6":0,
+				"false6":false,
+				"nil6":false,
+				"obj6":      null                
+				
+}
+			]
+		
+}
+
+
+
+                 	
                                                      ,
+	"special-7":"\\f\n\r\t\uffff",
+	"unicode-\u0000- 7":"\u5656",
+	"bigdecimal7":7817265.00000111,
+	"bigdecimal-2-7":127655512123456.761009E-123,
+	"string-7":"lorem ipsum, ÄÖÜäöü.-,<!$%&/()9876543XXddddJJJJJJhhhhhhhh",
+	"int7":4561,
+	"ints7":0,
+	"false7":false,
+	"nil7":false,
+	"n7":      null                ,
+	"obj7":
+		{
+			"special-7":"\\f\n\r\t\uffff",
+			"unicode-\u0000- 7":"\u5656",
+	"bigdecimal7":7817265.00000111,
+			"bigdecimal-2-7":127655512123456.761009E-123,
+			"string-7":"lorem ipsum, ÄÖÜäöü.-,<!$%&/()9876543XXddddJJJJJJhhhhhhhh",
+			"int7":4561,
+			"ints7":0,
+			"false7":false,
+			"nil7":false,
+			"obj7":      null                ,
+			"obj7":
+				[    true    ,
+				{
+				"special-7":"\\f\n\r\t\uffff",
+				"unicode-\u0000- 7":"\u5656",
+				"bigdecimal7":7817265.00000111,
+				"bigdecimal-2-7":127655512123456.761009E-123,
+				"string-7":"lorem ipsum, ÄÖÜäöü.-,<!$%&/()9876543XXddddJJJJJJhhhhhhhh",
+				"int7":4561,
+				"ints7":0,
+				"false7":false,
+				"nil7":false,
+				"obj7":      null                
+				
+}
+			]
+		
+}
+
+
+
+                 	
                                                      ,
+	"special-8":"\\f\n\r\t\uffff",
+	"unicode-\u0000- 8":"\u5656",
+	"bigdecimal8":7817265.00000111,
+	"bigdecimal-2-8":127655512123456.761009E-123,
+	"string-8":"lorem ipsum, ÄÖÜäöü.-,<!$%&/()9876543XXddddJJJJJJhhhhhhhh",
+	"int8":4561,
+	"ints8":0,
+	"false8":false,
+	"nil8":false,
+	"n8":      null                ,
+	"obj8":
+		{
+			"special-8":"\\f\n\r\t\uffff",
+			"unicode-\u0000- 8":"\u5656",
+	"bigdecimal8":7817265.00000111,
+			"bigdecimal-2-8":127655512123456.761009E-123,
+			"string-8":"lorem ipsum, ÄÖÜäöü.-,<!$%&/()9876543XXddddJJJJJJhhhhhhhh",
+			"int8":4561,
+			"ints8":0,
+			"false8":false,
+			"nil8":false,
+			"obj8":      null                ,
+			"obj8":
+				[    true    ,
+				{
+				"special-8":"\\f\n\r\t\uffff",
+				"unicode-\u0000- 8":"\u5656",
+				"bigdecimal8":7817265.00000111,
+				"bigdecimal-2-8":127655512123456.761009E-123,
+				"string-8":"lorem ipsum, ÄÖÜäöü.-,<!$%&/()9876543XXddddJJJJJJhhhhhhhh",
+				"int8":4561,
+				"ints8":0,
+				"false8":false,
+				"nil8":false,
+				"obj8":      null                
+				
+}
+			]
+		
+}
+
+
+
+                 	
                                                      ,
+	"special-9":"\\f\n\r\t\uffff",
+	"unicode-\u0000- 9":"\u5656",
+	"bigdecimal9":7817265.00000111,
+	"bigdecimal-2-9":127655512123456.761009E-123,
+	"string-9":"lorem ipsum, ÄÖÜäöü.-,<!$%&/()9876543XXddddJJJJJJhhhhhhhh",
+	"int9":4561,
+	"ints9":0,
+	"false9":false,
+	"nil9":false,
+	"n9":      null                ,
+	"obj9":
+		{
+			"special-9":"\\f\n\r\t\uffff",
+			"unicode-\u0000- 9":"\u5656",
+	"bigdecimal9":7817265.00000111,
+			"bigdecimal-2-9":127655512123456.761009E-123,
+			"string-9":"lorem ipsum, ÄÖÜäöü.-,<!$%&/()9876543XXddddJJJJJJhhhhhhhh",
+			"int9":4561,
+			"ints9":0,
+			"false9":false,
+			"nil9":false,
+			"obj9":      null                ,
+			"obj9":
+				[    true    ,
+				{
+				"special-9":"\\f\n\r\t\uffff",
+				"unicode-\u0000- 9":"\u5656",
+				"bigdecimal9":7817265.00000111,
+				"bigdecimal-2-9":127655512123456.761009E-123,
+				"string-9":"lorem ipsum, ÄÖÜäöü.-,<!$%&/()9876543XXddddJJJJJJhhhhhhhh",
+				"int9":4561,
+				"ints9":0,
+				"false9":false,
+				"nil9":false,
+				"obj9":      null                
+				
+}
+			]
+		
+}
+
+
+
+                 	
                                                      
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-johnzon/blob/6e86a53e/johnzon-core/src/test/resources/bench/small_3kb.json
----------------------------------------------------------------------
diff --git a/johnzon-core/src/test/resources/bench/small_3kb.json b/johnzon-core/src/test/resources/bench/small_3kb.json
new file mode 100644
index 0000000..c8994f0
--- /dev/null
+++ b/johnzon-core/src/test/resources/bench/small_3kb.json
@@ -0,0 +1,86 @@
+[
+  {
+    "id": 0,
+    "guid": "94ab4571-718f-4734-b331-c68c5d8f3acb",
+    "isActive": false,
+    "balance": "$3,105.88",
+    "picture": "http://placehold.it/32x32",
+    "age": 36,
+    "eyeColor": "brown",
+    "name": "Weiss Perkins",
+    "gender": "male",
+    "company": "SHOPABOUT",
+    "address": "989 Lake Street, Kipp, Kansas, 2455",
+    "about": "Sint pariatur nostrud aliquip amet elit commodo aliqua. Fugiat nisi dolore aliquip eu. Exercitation dolore cupidatat mollit occaecat minim aliqua pariatur esse esse amet mollit. In dolor voluptate Lorem incididunt voluptate.\r\n",
+    "registered": "2014-03-23T01:37:39 -01:00",
+    "latitude": 80.963663,
+    "longitude": 4.258947,
+    "tags": [
+      "reprehenderit",
+      "incididunt",
+      "dolor",
+      "nostrud",
+      "id",
+      "culpa",
+      "id"
+    ],
+    "friends": [
+      {
+        "id": 0,
+        "name": "Kimberley Snider"
+      },
+      {
+        "id": 1,
+        "name": "Natasha Hoover"
+      },
+      {
+        "id": 2,
+        "name": "Susana Griffith"
+      }
+    ],
+    "greeting": "Hello, Weiss Perkins! You have 6 unread messages.",
+    "favoriteFruit": "banana"
+  },
+  {
+    "id": 1,
+    "guid": "ca3edf43-8a4c-4102-8f00-ab34fc3242e5",
+    "isActive": true,
+    "balance": "$1,349.81",
+    "picture": "http://placehold.it/32x32",
+    "age": 36,
+    "eyeColor": "blue",
+    "name": "Bessie Koch",
+    "gender": "female",
+    "company": "GEEKY",
+    "address": "318 Noll Street, Toftrees, Washington, 4804",
+    "about": "Consectetur ullamco occaecat cillum amet consequat laboris aliqua qui anim mollit. Esse cillum laborum ipsum esse in reprehenderit irure ex. Ex duis fugiat elit do minim amet Lorem fugiat. Eu ea sit sunt do consequat anim deserunt voluptate in cupidatat id. Labore Lorem est laborum consequat sint exercitation nostrud officia. In velit cupidatat et magna duis aute excepteur tempor eiusmod qui aliquip. Nisi ea anim dolore fugiat fugiat voluptate commodo ullamco id in magna consequat.\r\n",
+    "registered": "2014-06-15T14:31:59 -02:00",
+    "latitude": -22.556508,
+    "longitude": 96.155538,
+    "tags": [
+      "commodo",
+      "reprehenderit",
+      "consectetur",
+      "exercitation",
+      "culpa",
+      "voluptate",
+      "laboris"
+    ],
+    "friends": [
+      {
+        "id": 0,
+        "name": "Duffy Stokes"
+      },
+      {
+        "id": 1,
+        "name": "Faye Wilkins"
+      },
+      {
+        "id": 2,
+        "name": "Blackburn Franklin"
+      }
+    ],
+    "greeting": "Hello, Bessie Koch! You have 7 unread messages.",
+    "favoriteFruit": "strawberry"
+  }
+]
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-johnzon/blob/6e86a53e/johnzon-core/src/test/resources/bench/tiny_50b.json
----------------------------------------------------------------------
diff --git a/johnzon-core/src/test/resources/bench/tiny_50b.json b/johnzon-core/src/test/resources/bench/tiny_50b.json
new file mode 100644
index 0000000..33e0693
--- /dev/null
+++ b/johnzon-core/src/test/resources/bench/tiny_50b.json
@@ -0,0 +1,5 @@
+{
+    "debug": "false\ttrue",
+    "number" : 1.4E10
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-johnzon/blob/6e86a53e/johnzon-core/src/test/resources/bench/unicode_chars_1400kb.txt
----------------------------------------------------------------------
diff --git a/johnzon-core/src/test/resources/bench/unicode_chars_1400kb.txt b/johnzon-core/src/test/resources/bench/unicode_chars_1400kb.txt
new file mode 100644
index 0000000..576c24d
Binary files /dev/null and b/johnzon-core/src/test/resources/bench/unicode_chars_1400kb.txt differ

http://git-wip-us.apache.org/repos/asf/incubator-johnzon/blob/6e86a53e/johnzon-core/src/test/resources/bench/unicode_chars_170kb.txt
----------------------------------------------------------------------
diff --git a/johnzon-core/src/test/resources/bench/unicode_chars_170kb.txt b/johnzon-core/src/test/resources/bench/unicode_chars_170kb.txt
new file mode 100644
index 0000000..b06ecff
Binary files /dev/null and b/johnzon-core/src/test/resources/bench/unicode_chars_170kb.txt differ

http://git-wip-us.apache.org/repos/asf/incubator-johnzon/blob/6e86a53e/johnzon-core/src/test/resources/json/array.json
----------------------------------------------------------------------
diff --git a/johnzon-core/src/test/resources/json/array.json b/johnzon-core/src/test/resources/json/array.json
new file mode 100644
index 0000000..6e6bf04
--- /dev/null
+++ b/johnzon-core/src/test/resources/json/array.json
@@ -0,0 +1,8 @@
+[
+    "a",
+    1,
+    {
+        "b": "c"
+    },
+    5
+]
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-johnzon/blob/6e86a53e/johnzon-core/src/test/resources/json/bigdecimal.json
----------------------------------------------------------------------
diff --git a/johnzon-core/src/test/resources/json/bigdecimal.json b/johnzon-core/src/test/resources/json/bigdecimal.json
new file mode 100644
index 0000000..0e4f377
--- /dev/null
+++ b/johnzon-core/src/test/resources/json/bigdecimal.json
@@ -0,0 +1,5 @@
+{
+    "a": 1.23E3,
+    "b": 1.23E-3,
+    "c": 1.23E+3
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-johnzon/blob/6e86a53e/johnzon-core/src/test/resources/json/empty.json
----------------------------------------------------------------------
diff --git a/johnzon-core/src/test/resources/json/empty.json b/johnzon-core/src/test/resources/json/empty.json
new file mode 100644
index 0000000..9e26dfe
--- /dev/null
+++ b/johnzon-core/src/test/resources/json/empty.json
@@ -0,0 +1 @@
+{}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-johnzon/blob/6e86a53e/johnzon-core/src/test/resources/json/emptyarray.json
----------------------------------------------------------------------
diff --git a/johnzon-core/src/test/resources/json/emptyarray.json b/johnzon-core/src/test/resources/json/emptyarray.json
new file mode 100644
index 0000000..90b2a13
--- /dev/null
+++ b/johnzon-core/src/test/resources/json/emptyarray.json
@@ -0,0 +1,3 @@
+[	
+ 
+]
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-johnzon/blob/6e86a53e/johnzon-core/src/test/resources/json/escaping.json
----------------------------------------------------------------------
diff --git a/johnzon-core/src/test/resources/json/escaping.json b/johnzon-core/src/test/resources/json/escaping.json
new file mode 100644
index 0000000..0f4e49b
--- /dev/null
+++ b/johnzon-core/src/test/resources/json/escaping.json
@@ -0,0 +1,11 @@
+[
+    "\"",
+    "\\",
+    "\/",
+    "\b",
+    "\f",
+    "\n",
+    "\r",
+    "\t",
+    "\u0044"
+]
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-johnzon/blob/6e86a53e/johnzon-core/src/test/resources/json/fails/fail1.json
----------------------------------------------------------------------
diff --git a/johnzon-core/src/test/resources/json/fails/fail1.json b/johnzon-core/src/test/resources/json/fails/fail1.json
new file mode 100644
index 0000000..45dd52e
--- /dev/null
+++ b/johnzon-core/src/test/resources/json/fails/fail1.json
@@ -0,0 +1,8 @@
+{,
+    "a": "b",
+    "c": 4,
+    "d": [
+        1,
+        2
+    ]
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-johnzon/blob/6e86a53e/johnzon-core/src/test/resources/json/fails/fail10.json
----------------------------------------------------------------------
diff --git a/johnzon-core/src/test/resources/json/fails/fail10.json b/johnzon-core/src/test/resources/json/fails/fail10.json
new file mode 100644
index 0000000..57374c0
--- /dev/null
+++ b/johnzon-core/src/test/resources/json/fails/fail10.json
@@ -0,0 +1,7 @@
+{
+    "a": "b",
+    "c": 4,
+    "d": [
+        1,
+        2
+    ]

http://git-wip-us.apache.org/repos/asf/incubator-johnzon/blob/6e86a53e/johnzon-core/src/test/resources/json/fails/fail11.json
----------------------------------------------------------------------
diff --git a/johnzon-core/src/test/resources/json/fails/fail11.json b/johnzon-core/src/test/resources/json/fails/fail11.json
new file mode 100644
index 0000000..5c18af6
--- /dev/null
+++ b/johnzon-core/src/test/resources/json/fails/fail11.json
@@ -0,0 +1,8 @@
+
+    "a": "b",
+    "c": 4,
+    "d": [
+        1,
+        2
+    ]
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-johnzon/blob/6e86a53e/johnzon-core/src/test/resources/json/fails/fail12.json
----------------------------------------------------------------------
diff --git a/johnzon-core/src/test/resources/json/fails/fail12.json b/johnzon-core/src/test/resources/json/fails/fail12.json
new file mode 100644
index 0000000..fec9295
--- /dev/null
+++ b/johnzon-core/src/test/resources/json/fails/fail12.json
@@ -0,0 +1,8 @@
+{    q
+    "a": "b",
+    "c": 4,
+    "d": [
+        1,
+        2
+    ]
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-johnzon/blob/6e86a53e/johnzon-core/src/test/resources/json/fails/fail13.json
----------------------------------------------------------------------
diff --git a/johnzon-core/src/test/resources/json/fails/fail13.json b/johnzon-core/src/test/resources/json/fails/fail13.json
new file mode 100644
index 0000000..838ba2c
--- /dev/null
+++ b/johnzon-core/src/test/resources/json/fails/fail13.json
@@ -0,0 +1,8 @@
+{	
+    "a": "b",
+    "c": nul,
+    "d": [
+        1,
+        2
+    ]
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-johnzon/blob/6e86a53e/johnzon-core/src/test/resources/json/fails/fail14.json
----------------------------------------------------------------------
diff --git a/johnzon-core/src/test/resources/json/fails/fail14.json b/johnzon-core/src/test/resources/json/fails/fail14.json
new file mode 100644
index 0000000..f9e9a91
--- /dev/null
+++ b/johnzon-core/src/test/resources/json/fails/fail14.json
@@ -0,0 +1,8 @@
+{	"x":
+    "a": "b",
+    "c": 4,
+    "d"": [
+        1,
+        2
+    ]
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-johnzon/blob/6e86a53e/johnzon-core/src/test/resources/json/fails/fail15.json
----------------------------------------------------------------------
diff --git a/johnzon-core/src/test/resources/json/fails/fail15.json b/johnzon-core/src/test/resources/json/fails/fail15.json
new file mode 100644
index 0000000..518dcb3
--- /dev/null
+++ b/johnzon-core/src/test/resources/json/fails/fail15.json
@@ -0,0 +1,11 @@
+{
+
+	true,
+    "a": "b",
+    "c": {
+        "d": [
+            1,
+            2
+        ]
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-johnzon/blob/6e86a53e/johnzon-core/src/test/resources/json/fails/fail16.json
----------------------------------------------------------------------
diff --git a/johnzon-core/src/test/resources/json/fails/fail16.json b/johnzon-core/src/test/resources/json/fails/fail16.json
new file mode 100644
index 0000000..75f8856
--- /dev/null
+++ b/johnzon-core/src/test/resources/json/fails/fail16.json
@@ -0,0 +1,9 @@
+{
+    "a": "b",
+    "c": {
+        d: [
+            1,
+            2
+        ]
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-johnzon/blob/6e86a53e/johnzon-core/src/test/resources/json/fails/fail17.json
----------------------------------------------------------------------
diff --git a/johnzon-core/src/test/resources/json/fails/fail17.json b/johnzon-core/src/test/resources/json/fails/fail17.json
new file mode 100644
index 0000000..7e44be3
--- /dev/null
+++ b/johnzon-core/src/test/resources/json/fails/fail17.json
@@ -0,0 +1,9 @@
+{
+    "a": "b",
+    "c": true {
+        "d": [
+            1,
+            2
+        ]
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-johnzon/blob/6e86a53e/johnzon-core/src/test/resources/json/fails/fail18.json
----------------------------------------------------------------------
diff --git a/johnzon-core/src/test/resources/json/fails/fail18.json b/johnzon-core/src/test/resources/json/fails/fail18.json
new file mode 100644
index 0000000..c4048ac
--- /dev/null
+++ b/johnzon-core/src/test/resources/json/fails/fail18.json
@@ -0,0 +1,11 @@
+{
+
+	true
+    "a": "b",
+    "c": {
+        "d": [
+            1,
+            2
+        ]
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-johnzon/blob/6e86a53e/johnzon-core/src/test/resources/json/fails/fail19.json
----------------------------------------------------------------------
diff --git a/johnzon-core/src/test/resources/json/fails/fail19.json b/johnzon-core/src/test/resources/json/fails/fail19.json
new file mode 100644
index 0000000..686038c
--- /dev/null
+++ b/johnzon-core/src/test/resources/json/fails/fail19.json
@@ -0,0 +1,10 @@
+{
+
+    "a": "b",
+    "c": {
+        "d": [
+            1,
+            2
+        ]
+    }
+]
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-johnzon/blob/6e86a53e/johnzon-core/src/test/resources/json/fails/fail2.json
----------------------------------------------------------------------
diff --git a/johnzon-core/src/test/resources/json/fails/fail2.json b/johnzon-core/src/test/resources/json/fails/fail2.json
new file mode 100644
index 0000000..e5ac24b
--- /dev/null
+++ b/johnzon-core/src/test/resources/json/fails/fail2.json
@@ -0,0 +1,8 @@
+{
+    "a":: "b",
+    "c": 4,
+    "d": [
+        1,
+        2
+    ]
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-johnzon/blob/6e86a53e/johnzon-core/src/test/resources/json/fails/fail20.json
----------------------------------------------------------------------
diff --git a/johnzon-core/src/test/resources/json/fails/fail20.json b/johnzon-core/src/test/resources/json/fails/fail20.json
new file mode 100644
index 0000000..cb4b1a3
--- /dev/null
+++ b/johnzon-core/src/test/resources/json/fails/fail20.json
@@ -0,0 +1,10 @@
+{
+
+    "a": "b",
+    "c": {
+        "d": [
+            01,
+            2
+        ]
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-johnzon/blob/6e86a53e/johnzon-core/src/test/resources/json/fails/fail21.json
----------------------------------------------------------------------
diff --git a/johnzon-core/src/test/resources/json/fails/fail21.json b/johnzon-core/src/test/resources/json/fails/fail21.json
new file mode 100644
index 0000000..b992e92
--- /dev/null
+++ b/johnzon-core/src/test/resources/json/fails/fail21.json
@@ -0,0 +1,10 @@
+{
+
+    "a": "b",
+    "c": {
+        "d": [
+            1.24ee-20,
+            2
+        ]
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-johnzon/blob/6e86a53e/johnzon-core/src/test/resources/json/fails/fail22.json
----------------------------------------------------------------------
diff --git a/johnzon-core/src/test/resources/json/fails/fail22.json b/johnzon-core/src/test/resources/json/fails/fail22.json
new file mode 100644
index 0000000..3294a90
--- /dev/null
+++ b/johnzon-core/src/test/resources/json/fails/fail22.json
@@ -0,0 +1 @@
+garbage in garbage out
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-johnzon/blob/6e86a53e/johnzon-core/src/test/resources/json/fails/fail23.json
----------------------------------------------------------------------
diff --git a/johnzon-core/src/test/resources/json/fails/fail23.json b/johnzon-core/src/test/resources/json/fails/fail23.json
new file mode 100644
index 0000000..b10e1d9
--- /dev/null
+++ b/johnzon-core/src/test/resources/json/fails/fail23.json
@@ -0,0 +1,8 @@
+{
+    "a": "\u6565",
+    "c": "\u123",
+    "d": [
+        
+        -2, "\u0048"
+    ]
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-johnzon/blob/6e86a53e/johnzon-core/src/test/resources/json/fails/fail24.json
----------------------------------------------------------------------
diff --git a/johnzon-core/src/test/resources/json/fails/fail24.json b/johnzon-core/src/test/resources/json/fails/fail24.json
new file mode 100644
index 0000000..95fcffd
--- /dev/null
+++ b/johnzon-core/src/test/resources/json/fails/fail24.json
@@ -0,0 +1,5 @@
+{
+    "a": "a",
+    "c": \u0074\u0072\u0075\u0065
+   
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-johnzon/blob/6e86a53e/johnzon-core/src/test/resources/json/fails/fail25.json
----------------------------------------------------------------------
diff --git a/johnzon-core/src/test/resources/json/fails/fail25.json b/johnzon-core/src/test/resources/json/fails/fail25.json
new file mode 100644
index 0000000..f72b803
--- /dev/null
+++ b/johnzon-core/src/test/resources/json/fails/fail25.json
@@ -0,0 +1,8 @@
+{
+    "a": "\u6565",
+    "c": "\up000",
+    "d": [
+        
+        -2, "\u0044"
+    ]
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-johnzon/blob/6e86a53e/johnzon-core/src/test/resources/json/fails/fail26.json
----------------------------------------------------------------------
diff --git a/johnzon-core/src/test/resources/json/fails/fail26.json b/johnzon-core/src/test/resources/json/fails/fail26.json
new file mode 100644
index 0000000..128454e
--- /dev/null
+++ b/johnzon-core/src/test/resources/json/fails/fail26.json
@@ -0,0 +1,7 @@
+,{
+    "a": "\u6565",
+    "d": [
+        
+        -2, "\u0044"
+    ]
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-johnzon/blob/6e86a53e/johnzon-core/src/test/resources/json/fails/fail27.json
----------------------------------------------------------------------
diff --git a/johnzon-core/src/test/resources/json/fails/fail27.json b/johnzon-core/src/test/resources/json/fails/fail27.json
new file mode 100644
index 0000000..3ae9085
--- /dev/null
+++ b/johnzon-core/src/test/resources/json/fails/fail27.json
@@ -0,0 +1,7 @@
+"{
+    "a": "\u6565",
+    "d": [
+        
+        -2, "\u0044"
+    ]
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-johnzon/blob/6e86a53e/johnzon-core/src/test/resources/json/fails/fail28.json
----------------------------------------------------------------------
diff --git a/johnzon-core/src/test/resources/json/fails/fail28.json b/johnzon-core/src/test/resources/json/fails/fail28.json
new file mode 100644
index 0000000..11ba875
--- /dev/null
+++ b/johnzon-core/src/test/resources/json/fails/fail28.json
@@ -0,0 +1,7 @@
+true, {
+    "a": "\u6565",
+    "d": [
+        
+        -2, "\u0044"
+    ]
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-johnzon/blob/6e86a53e/johnzon-core/src/test/resources/json/fails/fail29.json
----------------------------------------------------------------------
diff --git a/johnzon-core/src/test/resources/json/fails/fail29.json b/johnzon-core/src/test/resources/json/fails/fail29.json
new file mode 100644
index 0000000..8eff000
--- /dev/null
+++ b/johnzon-core/src/test/resources/json/fails/fail29.json
@@ -0,0 +1,7 @@
+  :   {
+    "a": "\u6565",
+    "d": [
+        
+        -2, "\u0044"
+    ]
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-johnzon/blob/6e86a53e/johnzon-core/src/test/resources/json/fails/fail3.json
----------------------------------------------------------------------
diff --git a/johnzon-core/src/test/resources/json/fails/fail3.json b/johnzon-core/src/test/resources/json/fails/fail3.json
new file mode 100644
index 0000000..edec226
--- /dev/null
+++ b/johnzon-core/src/test/resources/json/fails/fail3.json
@@ -0,0 +1,8 @@
+{
+    "a": , "b",
+    "c": 4,
+    "d": [
+        1,
+        2
+    ]
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-johnzon/blob/6e86a53e/johnzon-core/src/test/resources/json/fails/fail30.json
----------------------------------------------------------------------
diff --git a/johnzon-core/src/test/resources/json/fails/fail30.json b/johnzon-core/src/test/resources/json/fails/fail30.json
new file mode 100644
index 0000000..555e395
--- /dev/null
+++ b/johnzon-core/src/test/resources/json/fails/fail30.json
@@ -0,0 +1,7 @@
+null{
+    "a": "\u6565",
+    "d": [
+        
+        -2, "\u0044"
+    ]
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-johnzon/blob/6e86a53e/johnzon-core/src/test/resources/json/fails/fail31.json
----------------------------------------------------------------------
diff --git a/johnzon-core/src/test/resources/json/fails/fail31.json b/johnzon-core/src/test/resources/json/fails/fail31.json
new file mode 100644
index 0000000..f1c8332
--- /dev/null
+++ b/johnzon-core/src/test/resources/json/fails/fail31.json
@@ -0,0 +1,7 @@
+"string":{
+    "a": "\u6565",
+    "d": [
+        
+        -2, "\u0044"
+    ]
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-johnzon/blob/6e86a53e/johnzon-core/src/test/resources/json/fails/fail32.json
----------------------------------------------------------------------
diff --git a/johnzon-core/src/test/resources/json/fails/fail32.json b/johnzon-core/src/test/resources/json/fails/fail32.json
new file mode 100644
index 0000000..7883a28
--- /dev/null
+++ b/johnzon-core/src/test/resources/json/fails/fail32.json
@@ -0,0 +1,7 @@
+{
+    "a": "\u6565",
+    "d": [
+        
+        -2, 20e-1.2
+    ]
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-johnzon/blob/6e86a53e/johnzon-core/src/test/resources/json/fails/fail33.json
----------------------------------------------------------------------
diff --git a/johnzon-core/src/test/resources/json/fails/fail33.json b/johnzon-core/src/test/resources/json/fails/fail33.json
new file mode 100644
index 0000000..308571d
--- /dev/null
+++ b/johnzon-core/src/test/resources/json/fails/fail33.json
@@ -0,0 +1,7 @@
+14{
+    "a": "\u6565",
+    "d": [
+        
+        -2, "\u0044"
+    ]
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-johnzon/blob/6e86a53e/johnzon-core/src/test/resources/json/fails/fail34.json
----------------------------------------------------------------------
diff --git a/johnzon-core/src/test/resources/json/fails/fail34.json b/johnzon-core/src/test/resources/json/fails/fail34.json
new file mode 100644
index 0000000..619a684
--- /dev/null
+++ b/johnzon-core/src/test/resources/json/fails/fail34.json
@@ -0,0 +1,7 @@
+{
+    "a": "\u6565",
+    "d": [
+        
+        -2, 2.0e-1.2
+    ]
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-johnzon/blob/6e86a53e/johnzon-core/src/test/resources/json/fails/fail35.json
----------------------------------------------------------------------
diff --git a/johnzon-core/src/test/resources/json/fails/fail35.json b/johnzon-core/src/test/resources/json/fails/fail35.json
new file mode 100644
index 0000000..cfda2b8
--- /dev/null
+++ b/johnzon-core/src/test/resources/json/fails/fail35.json
@@ -0,0 +1,7 @@
+ ,   {
+    "a": "\u6565",
+    "d": [
+        
+        -2, "\u0044"
+    ]
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-johnzon/blob/6e86a53e/johnzon-core/src/test/resources/json/fails/fail36.json
----------------------------------------------------------------------
diff --git a/johnzon-core/src/test/resources/json/fails/fail36.json b/johnzon-core/src/test/resources/json/fails/fail36.json
new file mode 100644
index 0000000..57fff2f
--- /dev/null
+++ b/johnzon-core/src/test/resources/json/fails/fail36.json
@@ -0,0 +1,3 @@
+{
+    "a": "	"
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-johnzon/blob/6e86a53e/johnzon-core/src/test/resources/json/fails/fail37.json
----------------------------------------------------------------------
diff --git a/johnzon-core/src/test/resources/json/fails/fail37.json b/johnzon-core/src/test/resources/json/fails/fail37.json
new file mode 100644
index 0000000..6e894f9
--- /dev/null
+++ b/johnzon-core/src/test/resources/json/fails/fail37.json
@@ -0,0 +1,4 @@
+{
+    "a
+    ": "x"
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-johnzon/blob/6e86a53e/johnzon-core/src/test/resources/json/fails/fail38.json
----------------------------------------------------------------------
diff --git a/johnzon-core/src/test/resources/json/fails/fail38.json b/johnzon-core/src/test/resources/json/fails/fail38.json
new file mode 100644
index 0000000..0c90427
--- /dev/null
+++ b/johnzon-core/src/test/resources/json/fails/fail38.json
@@ -0,0 +1,3 @@
+{
+    "a": 12.2e-
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-johnzon/blob/6e86a53e/johnzon-core/src/test/resources/json/fails/fail39.json
----------------------------------------------------------------------
diff --git a/johnzon-core/src/test/resources/json/fails/fail39.json b/johnzon-core/src/test/resources/json/fails/fail39.json
new file mode 100644
index 0000000..ac47891
--- /dev/null
+++ b/johnzon-core/src/test/resources/json/fails/fail39.json
@@ -0,0 +1,3 @@
+{
+    "a": 12.2e
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-johnzon/blob/6e86a53e/johnzon-core/src/test/resources/json/fails/fail4.json
----------------------------------------------------------------------
diff --git a/johnzon-core/src/test/resources/json/fails/fail4.json b/johnzon-core/src/test/resources/json/fails/fail4.json
new file mode 100644
index 0000000..70fbe2f
--- /dev/null
+++ b/johnzon-core/src/test/resources/json/fails/fail4.json
@@ -0,0 +1,8 @@
+{
+    "a": "b",,
+    "c": 4,
+    "d": [
+        1,
+        2
+    ]
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-johnzon/blob/6e86a53e/johnzon-core/src/test/resources/json/fails/fail40.json
----------------------------------------------------------------------
diff --git a/johnzon-core/src/test/resources/json/fails/fail40.json b/johnzon-core/src/test/resources/json/fails/fail40.json
new file mode 100644
index 0000000..7a503fb
--- /dev/null
+++ b/johnzon-core/src/test/resources/json/fails/fail40.json
@@ -0,0 +1,4 @@
+{
+    "a": "v"
+}
+some garbage
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-johnzon/blob/6e86a53e/johnzon-core/src/test/resources/json/fails/fail41.json
----------------------------------------------------------------------
diff --git a/johnzon-core/src/test/resources/json/fails/fail41.json b/johnzon-core/src/test/resources/json/fails/fail41.json
new file mode 100644
index 0000000..352963d
--- /dev/null
+++ b/johnzon-core/src/test/resources/json/fails/fail41.json
@@ -0,0 +1,3 @@
+{
+    "a": "\vbadescape"
+}

http://git-wip-us.apache.org/repos/asf/incubator-johnzon/blob/6e86a53e/johnzon-core/src/test/resources/json/fails/fail42.json
----------------------------------------------------------------------
diff --git a/johnzon-core/src/test/resources/json/fails/fail42.json b/johnzon-core/src/test/resources/json/fails/fail42.json
new file mode 100644
index 0000000..ed6e301
--- /dev/null
+++ b/johnzon-core/src/test/resources/json/fails/fail42.json
@@ -0,0 +1,3 @@
+{
+    "a": -055
+}

http://git-wip-us.apache.org/repos/asf/incubator-johnzon/blob/6e86a53e/johnzon-core/src/test/resources/json/fails/fail43.json
----------------------------------------------------------------------
diff --git a/johnzon-core/src/test/resources/json/fails/fail43.json b/johnzon-core/src/test/resources/json/fails/fail43.json
new file mode 100644
index 0000000..46fcf2e
--- /dev/null
+++ b/johnzon-core/src/test/resources/json/fails/fail43.json
@@ -0,0 +1,3 @@
+{
+    "a": -01.55
+}

http://git-wip-us.apache.org/repos/asf/incubator-johnzon/blob/6e86a53e/johnzon-core/src/test/resources/json/fails/fail44.json
----------------------------------------------------------------------
diff --git a/johnzon-core/src/test/resources/json/fails/fail44.json b/johnzon-core/src/test/resources/json/fails/fail44.json
new file mode 100644
index 0000000..4e963bb
--- /dev/null
+++ b/johnzon-core/src/test/resources/json/fails/fail44.json
@@ -0,0 +1,3 @@
+{
+    "a": -00001.55
+}

http://git-wip-us.apache.org/repos/asf/incubator-johnzon/blob/6e86a53e/johnzon-core/src/test/resources/json/fails/fail45.json
----------------------------------------------------------------------
diff --git a/johnzon-core/src/test/resources/json/fails/fail45.json b/johnzon-core/src/test/resources/json/fails/fail45.json
new file mode 100644
index 0000000..ccc49ff
--- /dev/null
+++ b/johnzon-core/src/test/resources/json/fails/fail45.json
@@ -0,0 +1,3 @@
+{
+    "a": " before this word the is a u+0001 char"
+}

http://git-wip-us.apache.org/repos/asf/incubator-johnzon/blob/6e86a53e/johnzon-core/src/test/resources/json/fails/fail46.json
----------------------------------------------------------------------
diff --git a/johnzon-core/src/test/resources/json/fails/fail46.json b/johnzon-core/src/test/resources/json/fails/fail46.json
new file mode 100644
index 0000000..54b8681
--- /dev/null
+++ b/johnzon-core/src/test/resources/json/fails/fail46.json
@@ -0,0 +1,3 @@
+{
+    "a": "before this is a u+00031 char"
+}

http://git-wip-us.apache.org/repos/asf/incubator-johnzon/blob/6e86a53e/johnzon-core/src/test/resources/json/fails/fail47.json
----------------------------------------------------------------------
diff --git a/johnzon-core/src/test/resources/json/fails/fail47.json b/johnzon-core/src/test/resources/json/fails/fail47.json
new file mode 100644
index 0000000..13f6f1d
--- /dev/null
+++ b/johnzon-core/src/test/resources/json/fails/fail47.json
@@ -0,0 +1 @@
+[1,]
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-johnzon/blob/6e86a53e/johnzon-core/src/test/resources/json/fails/fail48.json
----------------------------------------------------------------------
diff --git a/johnzon-core/src/test/resources/json/fails/fail48.json b/johnzon-core/src/test/resources/json/fails/fail48.json
new file mode 100644
index 0000000..e4d4ddd
--- /dev/null
+++ b/johnzon-core/src/test/resources/json/fails/fail48.json
@@ -0,0 +1,6 @@
+[1,
+2,
+3,
+4,
+5,
+]
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-johnzon/blob/6e86a53e/johnzon-core/src/test/resources/json/fails/fail49.json
----------------------------------------------------------------------
diff --git a/johnzon-core/src/test/resources/json/fails/fail49.json b/johnzon-core/src/test/resources/json/fails/fail49.json
new file mode 100644
index 0000000..3acaa8f
--- /dev/null
+++ b/johnzon-core/src/test/resources/json/fails/fail49.json
@@ -0,0 +1 @@
+{"a":1,}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-johnzon/blob/6e86a53e/johnzon-core/src/test/resources/json/fails/fail5.json
----------------------------------------------------------------------
diff --git a/johnzon-core/src/test/resources/json/fails/fail5.json b/johnzon-core/src/test/resources/json/fails/fail5.json
new file mode 100644
index 0000000..2fd140f
--- /dev/null
+++ b/johnzon-core/src/test/resources/json/fails/fail5.json
@@ -0,0 +1,8 @@
+{
+    "a": "b",
+    "c": 4,
+    "d": [
+        1 2,
+        2
+    ]
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-johnzon/blob/6e86a53e/johnzon-core/src/test/resources/json/fails/fail50.json
----------------------------------------------------------------------
diff --git a/johnzon-core/src/test/resources/json/fails/fail50.json b/johnzon-core/src/test/resources/json/fails/fail50.json
new file mode 100644
index 0000000..c7e2925
--- /dev/null
+++ b/johnzon-core/src/test/resources/json/fails/fail50.json
@@ -0,0 +1,4 @@
+{
+"a":1,
+"b":2,
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-johnzon/blob/6e86a53e/johnzon-core/src/test/resources/json/fails/fail51.json
----------------------------------------------------------------------
diff --git a/johnzon-core/src/test/resources/json/fails/fail51.json b/johnzon-core/src/test/resources/json/fails/fail51.json
new file mode 100644
index 0000000..dec2b86
--- /dev/null
+++ b/johnzon-core/src/test/resources/json/fails/fail51.json
@@ -0,0 +1 @@
+["\uDFAA (missing high surrogate)"]
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-johnzon/blob/6e86a53e/johnzon-core/src/test/resources/json/fails/fail52.json
----------------------------------------------------------------------
diff --git a/johnzon-core/src/test/resources/json/fails/fail52.json b/johnzon-core/src/test/resources/json/fails/fail52.json
new file mode 100644
index 0000000..eeea18b
--- /dev/null
+++ b/johnzon-core/src/test/resources/json/fails/fail52.json
@@ -0,0 +1 @@
+["\uD888\u3210 (invalid second surrogate)"]
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-johnzon/blob/6e86a53e/johnzon-core/src/test/resources/json/fails/fail53.json
----------------------------------------------------------------------
diff --git a/johnzon-core/src/test/resources/json/fails/fail53.json b/johnzon-core/src/test/resources/json/fails/fail53.json
new file mode 100644
index 0000000..5819cae
--- /dev/null
+++ b/johnzon-core/src/test/resources/json/fails/fail53.json
@@ -0,0 +1,11 @@
+{
+    "0": 0,
+    "0": -0,
+    "1": 1,
+    "-1": -1,
+    "9": 9,
+    "-9": -9,
+    "10": 10,
+    "-10", -10,
+    "100": 100
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-johnzon/blob/6e86a53e/johnzon-core/src/test/resources/json/fails/fail54.json
----------------------------------------------------------------------
diff --git a/johnzon-core/src/test/resources/json/fails/fail54.json b/johnzon-core/src/test/resources/json/fails/fail54.json
new file mode 100644
index 0000000..0fffc9b
--- /dev/null
+++ b/johnzon-core/src/test/resources/json/fails/fail54.json
@@ -0,0 +1,12 @@
+{
+    "0": 0,
+    "0": -0,
+    "1": 1,
+    "-1": -1,
+    "9": 9,
+    "-9": -9,
+    "10": 10,
+    "-10"  -10,
+    "100": 100,
+    "-100", -100
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-johnzon/blob/6e86a53e/johnzon-core/src/test/resources/json/fails/fail55.json
----------------------------------------------------------------------
diff --git a/johnzon-core/src/test/resources/json/fails/fail55.json b/johnzon-core/src/test/resources/json/fails/fail55.json
new file mode 100644
index 0000000..a3a4074
--- /dev/null
+++ b/johnzon-core/src/test/resources/json/fails/fail55.json
@@ -0,0 +1,12 @@
+{
+    "0": 0,
+    "0": -0,
+    "1": 1,
+    "-1": -1,
+    "9": 9,
+    "-9": -9,
+    "10": 10,
+    -10  -10,
+    "100": 100,
+    "-100", -100
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-johnzon/blob/6e86a53e/johnzon-core/src/test/resources/json/fails/fail56.json
----------------------------------------------------------------------
diff --git a/johnzon-core/src/test/resources/json/fails/fail56.json b/johnzon-core/src/test/resources/json/fails/fail56.json
new file mode 100644
index 0000000..820d41e
--- /dev/null
+++ b/johnzon-core/src/test/resources/json/fails/fail56.json
@@ -0,0 +1,11 @@
+{
+    "0": 0,
+    "0": -0,
+    "1": 1,
+    "-1": -1,
+    "9": 9,
+    "-9": -9,
+    "10": 10,
+    "-10", "-10",
+    "100": 100
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-johnzon/blob/6e86a53e/johnzon-core/src/test/resources/json/fails/fail57.json
----------------------------------------------------------------------
diff --git a/johnzon-core/src/test/resources/json/fails/fail57.json b/johnzon-core/src/test/resources/json/fails/fail57.json
new file mode 100644
index 0000000..ffe9c1c
--- /dev/null
+++ b/johnzon-core/src/test/resources/json/fails/fail57.json
@@ -0,0 +1 @@
+["a":3]
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-johnzon/blob/6e86a53e/johnzon-core/src/test/resources/json/fails/fail58.json
----------------------------------------------------------------------
diff --git a/johnzon-core/src/test/resources/json/fails/fail58.json b/johnzon-core/src/test/resources/json/fails/fail58.json
new file mode 100644
index 0000000..270b5d5
--- /dev/null
+++ b/johnzon-core/src/test/resources/json/fails/fail58.json
@@ -0,0 +1,3 @@
+{
+  "0":["a":3]
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-johnzon/blob/6e86a53e/johnzon-core/src/test/resources/json/fails/fail59.json
----------------------------------------------------------------------
diff --git a/johnzon-core/src/test/resources/json/fails/fail59.json b/johnzon-core/src/test/resources/json/fails/fail59.json
new file mode 100644
index 0000000..81750b9
--- /dev/null
+++ b/johnzon-core/src/test/resources/json/fails/fail59.json
@@ -0,0 +1 @@
+{
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-johnzon/blob/6e86a53e/johnzon-core/src/test/resources/json/fails/fail6.json
----------------------------------------------------------------------
diff --git a/johnzon-core/src/test/resources/json/fails/fail6.json b/johnzon-core/src/test/resources/json/fails/fail6.json
new file mode 100644
index 0000000..290615e
--- /dev/null
+++ b/johnzon-core/src/test/resources/json/fails/fail6.json
@@ -0,0 +1,8 @@
+{
+    "a": "b",
+    "c": 4,
+    "d": [
+        1,
+        2
+    ]]
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-johnzon/blob/6e86a53e/johnzon-core/src/test/resources/json/fails/fail60.json
----------------------------------------------------------------------
diff --git a/johnzon-core/src/test/resources/json/fails/fail60.json b/johnzon-core/src/test/resources/json/fails/fail60.json
new file mode 100644
index 0000000..17be25b
--- /dev/null
+++ b/johnzon-core/src/test/resources/json/fails/fail60.json
@@ -0,0 +1 @@
+[ {}, [] }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-johnzon/blob/6e86a53e/johnzon-core/src/test/resources/json/fails/fail61.json
----------------------------------------------------------------------
diff --git a/johnzon-core/src/test/resources/json/fails/fail61.json b/johnzon-core/src/test/resources/json/fails/fail61.json
new file mode 100644
index 0000000..0b9fc5b
--- /dev/null
+++ b/johnzon-core/src/test/resources/json/fails/fail61.json
@@ -0,0 +1,3 @@
+{
+    "a": -
+}

http://git-wip-us.apache.org/repos/asf/incubator-johnzon/blob/6e86a53e/johnzon-core/src/test/resources/json/fails/fail62.json
----------------------------------------------------------------------
diff --git a/johnzon-core/src/test/resources/json/fails/fail62.json b/johnzon-core/src/test/resources/json/fails/fail62.json
new file mode 100644
index 0000000..ac5e00d
--- /dev/null
+++ b/johnzon-core/src/test/resources/json/fails/fail62.json
@@ -0,0 +1,3 @@
+{
+    "a":
+}

http://git-wip-us.apache.org/repos/asf/incubator-johnzon/blob/6e86a53e/johnzon-core/src/test/resources/json/fails/fail63.json
----------------------------------------------------------------------
diff --git a/johnzon-core/src/test/resources/json/fails/fail63.json b/johnzon-core/src/test/resources/json/fails/fail63.json
new file mode 100644
index 0000000..29bdc57
--- /dev/null
+++ b/johnzon-core/src/test/resources/json/fails/fail63.json
@@ -0,0 +1,3 @@
+{
+    "a"
+}

http://git-wip-us.apache.org/repos/asf/incubator-johnzon/blob/6e86a53e/johnzon-core/src/test/resources/json/fails/fail64.json
----------------------------------------------------------------------
diff --git a/johnzon-core/src/test/resources/json/fails/fail64.json b/johnzon-core/src/test/resources/json/fails/fail64.json
new file mode 100644
index 0000000..3edb81e
--- /dev/null
+++ b/johnzon-core/src/test/resources/json/fails/fail64.json
@@ -0,0 +1,3 @@
+{
+    "a": 1.,
+}

http://git-wip-us.apache.org/repos/asf/incubator-johnzon/blob/6e86a53e/johnzon-core/src/test/resources/json/fails/fail65.json
----------------------------------------------------------------------
diff --git a/johnzon-core/src/test/resources/json/fails/fail65.json b/johnzon-core/src/test/resources/json/fails/fail65.json
new file mode 100644
index 0000000..3adb8bb
--- /dev/null
+++ b/johnzon-core/src/test/resources/json/fails/fail65.json
@@ -0,0 +1,3 @@
+{
+    "a": .5,
+}

http://git-wip-us.apache.org/repos/asf/incubator-johnzon/blob/6e86a53e/johnzon-core/src/test/resources/json/fails/fail66.json
----------------------------------------------------------------------
diff --git a/johnzon-core/src/test/resources/json/fails/fail66.json b/johnzon-core/src/test/resources/json/fails/fail66.json
new file mode 100644
index 0000000..129cac0
--- /dev/null
+++ b/johnzon-core/src/test/resources/json/fails/fail66.json
@@ -0,0 +1,3 @@
+{
+    "a": 1-,
+}

http://git-wip-us.apache.org/repos/asf/incubator-johnzon/blob/6e86a53e/johnzon-core/src/test/resources/json/fails/fail67.json
----------------------------------------------------------------------
diff --git a/johnzon-core/src/test/resources/json/fails/fail67.json b/johnzon-core/src/test/resources/json/fails/fail67.json
new file mode 100644
index 0000000..5df5fe3
--- /dev/null
+++ b/johnzon-core/src/test/resources/json/fails/fail67.json
@@ -0,0 +1,3 @@
+{
+    "a": 1.-,
+}

http://git-wip-us.apache.org/repos/asf/incubator-johnzon/blob/6e86a53e/johnzon-core/src/test/resources/json/fails/fail68.json
----------------------------------------------------------------------
diff --git a/johnzon-core/src/test/resources/json/fails/fail68.json b/johnzon-core/src/test/resources/json/fails/fail68.json
new file mode 100644
index 0000000..2c44166
--- /dev/null
+++ b/johnzon-core/src/test/resources/json/fails/fail68.json
@@ -0,0 +1,3 @@
+{
+    "a": 1.9e-1.2,
+}

http://git-wip-us.apache.org/repos/asf/incubator-johnzon/blob/6e86a53e/johnzon-core/src/test/resources/json/fails/fail69.json
----------------------------------------------------------------------
diff --git a/johnzon-core/src/test/resources/json/fails/fail69.json b/johnzon-core/src/test/resources/json/fails/fail69.json
new file mode 100644
index 0000000..349826b
--- /dev/null
+++ b/johnzon-core/src/test/resources/json/fails/fail69.json
@@ -0,0 +1,3 @@
+{
+    12
+}

http://git-wip-us.apache.org/repos/asf/incubator-johnzon/blob/6e86a53e/johnzon-core/src/test/resources/json/fails/fail7.json
----------------------------------------------------------------------
diff --git a/johnzon-core/src/test/resources/json/fails/fail7.json b/johnzon-core/src/test/resources/json/fails/fail7.json
new file mode 100644
index 0000000..072487f
--- /dev/null
+++ b/johnzon-core/src/test/resources/json/fails/fail7.json
@@ -0,0 +1,8 @@
+{
+    "a": "b",
+    "c": 4,
+    "d": [
+        1..56,
+        2
+    ]
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-johnzon/blob/6e86a53e/johnzon-core/src/test/resources/json/fails/fail70.json
----------------------------------------------------------------------
diff --git a/johnzon-core/src/test/resources/json/fails/fail70.json b/johnzon-core/src/test/resources/json/fails/fail70.json
new file mode 100644
index 0000000..0c90165
--- /dev/null
+++ b/johnzon-core/src/test/resources/json/fails/fail70.json
@@ -0,0 +1,3 @@
+{
+    null null
+}

http://git-wip-us.apache.org/repos/asf/incubator-johnzon/blob/6e86a53e/johnzon-core/src/test/resources/json/fails/fail71.json
----------------------------------------------------------------------
diff --git a/johnzon-core/src/test/resources/json/fails/fail71.json b/johnzon-core/src/test/resources/json/fails/fail71.json
new file mode 100644
index 0000000..819e165
--- /dev/null
+++ b/johnzon-core/src/test/resources/json/fails/fail71.json
@@ -0,0 +1,3 @@
+{
+    null
+}

http://git-wip-us.apache.org/repos/asf/incubator-johnzon/blob/6e86a53e/johnzon-core/src/test/resources/json/fails/fail72.json
----------------------------------------------------------------------
diff --git a/johnzon-core/src/test/resources/json/fails/fail72.json b/johnzon-core/src/test/resources/json/fails/fail72.json
new file mode 100644
index 0000000..02beb05
--- /dev/null
+++ b/johnzon-core/src/test/resources/json/fails/fail72.json
@@ -0,0 +1,3 @@
+{
+    "a","b"
+}

http://git-wip-us.apache.org/repos/asf/incubator-johnzon/blob/6e86a53e/johnzon-core/src/test/resources/json/fails/fail8.json
----------------------------------------------------------------------
diff --git a/johnzon-core/src/test/resources/json/fails/fail8.json b/johnzon-core/src/test/resources/json/fails/fail8.json
new file mode 100644
index 0000000..3de92f7
--- /dev/null
+++ b/johnzon-core/src/test/resources/json/fails/fail8.json
@@ -0,0 +1,8 @@
+{
+    "a": "b",
+    "c": 4,
+    "d": [
+        +1,
+        2
+    ]
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-johnzon/blob/6e86a53e/johnzon-core/src/test/resources/json/fails/fail9.json
----------------------------------------------------------------------
diff --git a/johnzon-core/src/test/resources/json/fails/fail9.json b/johnzon-core/src/test/resources/json/fails/fail9.json
new file mode 100644
index 0000000..9464907
--- /dev/null
+++ b/johnzon-core/src/test/resources/json/fails/fail9.json
@@ -0,0 +1,8 @@
+{
+    "a": "b",
+    "c": 4,
+    "d"": [
+        1,
+        2
+    ]
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-johnzon/blob/6e86a53e/johnzon-core/src/test/resources/json/fails/numbers.json
----------------------------------------------------------------------
diff --git a/johnzon-core/src/test/resources/json/fails/numbers.json b/johnzon-core/src/test/resources/json/fails/numbers.json
new file mode 100644
index 0000000..d300022
--- /dev/null
+++ b/johnzon-core/src/test/resources/json/fails/numbers.json
@@ -0,0 +1,18 @@
+{
+    "0": 0,
+    "0": -0,
+    "1": 1,
+    "-1": -1,
+    "9": 9,
+    "-9": -9,
+    "10": 10,
+    "-10", -10,
+    "100": 100,
+    "-100", -100,
+    "456": 456,
+    "-456": -456,
+    "123.12345": 123.12345,
+    "-123.12345": -123.12345,
+    "999999999999999999999999999999": 999999999999999999999999999999,
+    "-999999999999999999999999999999": -999999999999999999999999999999
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-johnzon/blob/6e86a53e/johnzon-core/src/test/resources/json/nested.json
----------------------------------------------------------------------
diff --git a/johnzon-core/src/test/resources/json/nested.json b/johnzon-core/src/test/resources/json/nested.json
new file mode 100644
index 0000000..d6f09f8
--- /dev/null
+++ b/johnzon-core/src/test/resources/json/nested.json
@@ -0,0 +1,9 @@
+{
+    "a": "b",
+    "c": {
+        "d": [
+            1,
+            2
+        ]
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-johnzon/blob/6e86a53e/johnzon-core/src/test/resources/json/numbers.json
----------------------------------------------------------------------
diff --git a/johnzon-core/src/test/resources/json/numbers.json b/johnzon-core/src/test/resources/json/numbers.json
new file mode 100644
index 0000000..847a9f8
--- /dev/null
+++ b/johnzon-core/src/test/resources/json/numbers.json
@@ -0,0 +1,18 @@
+{
+    "0": 0,
+    "0": -0,
+    "1": 1,
+    "-1": -1,
+    "9": 9,
+    "-9": -9,
+    "10": 10,
+    "-10": -10,
+    "100": 100,
+    "-100": -100,
+    "456": 456,
+    "-456": -456,
+    "123.12345": 123.12345,
+    "-123.12345": -123.12345,
+    "999999999999999999999999999999": 999999999999999999999999999999,
+    "-999999999999999999999999999999": -999999999999999999999999999999
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-johnzon/blob/6e86a53e/johnzon-core/src/test/resources/json/simple.json
----------------------------------------------------------------------
diff --git a/johnzon-core/src/test/resources/json/simple.json b/johnzon-core/src/test/resources/json/simple.json
new file mode 100644
index 0000000..78be59e
--- /dev/null
+++ b/johnzon-core/src/test/resources/json/simple.json
@@ -0,0 +1,8 @@
+{
+    "a": "b",
+    "c": 4,
+    "d": [
+        1,
+        -2
+    ]
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-johnzon/blob/6e86a53e/johnzon-core/src/test/resources/json/simple2.json
----------------------------------------------------------------------
diff --git a/johnzon-core/src/test/resources/json/simple2.json b/johnzon-core/src/test/resources/json/simple2.json
new file mode 100644
index 0000000..2578a23
--- /dev/null
+++ b/johnzon-core/src/test/resources/json/simple2.json
@@ -0,0 +1,8 @@
+{
+ "a": "b",
+ "c": 4,
+ "d": [
+  1,
+  -2
+    ]
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-johnzon/blob/6e86a53e/johnzon-core/src/test/resources/json/simple_utf16le.json
----------------------------------------------------------------------
diff --git a/johnzon-core/src/test/resources/json/simple_utf16le.json b/johnzon-core/src/test/resources/json/simple_utf16le.json
new file mode 100644
index 0000000..c2e2137
Binary files /dev/null and b/johnzon-core/src/test/resources/json/simple_utf16le.json differ

http://git-wip-us.apache.org/repos/asf/incubator-johnzon/blob/6e86a53e/johnzon-core/src/test/resources/json/special.json
----------------------------------------------------------------------
diff --git a/johnzon-core/src/test/resources/json/special.json b/johnzon-core/src/test/resources/json/special.json
new file mode 100644
index 0000000..065c1b3
--- /dev/null
+++ b/johnzon-core/src/test/resources/json/special.json
@@ -0,0 +1,18 @@
+{
+    "a{": "b,,",
+    "c::::": ":4::,[{",
+    "d": [
+        1,
+        2,
+        null,
+        false,
+        true,
+        4.2
+    ],
+    "w":4.6676123,
+    "r": 0.001,
+    "1.4312":110,
+    "\u0044":null,
+    "\"":"\"",
+    "থii:üäöÖ.,;.-<>!§$%&()=?ß´'`*+#":					"ন:4::,[{"
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-johnzon/blob/6e86a53e/johnzon-core/src/test/resources/json/stringescape.json
----------------------------------------------------------------------
diff --git a/johnzon-core/src/test/resources/json/stringescape.json b/johnzon-core/src/test/resources/json/stringescape.json
new file mode 100644
index 0000000..d9c3ddb
--- /dev/null
+++ b/johnzon-core/src/test/resources/json/stringescape.json
@@ -0,0 +1,3 @@
+{
+    "name": "s\"mit\""
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-johnzon/blob/6e86a53e/johnzon-core/src/test/resources/json/unicode.json
----------------------------------------------------------------------
diff --git a/johnzon-core/src/test/resources/json/unicode.json b/johnzon-core/src/test/resources/json/unicode.json
new file mode 100644
index 0000000..07e5d4d
--- /dev/null
+++ b/johnzon-core/src/test/resources/json/unicode.json
@@ -0,0 +1,10 @@
+{
+    "a": "\u6565",
+    "z": "",
+    "c": "\u0000",
+    "f": "\u0070\u0070\u0070a\u0070+++\u0070",
+    "d": [
+        
+        -2, "\u0020",""
+    ]
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-johnzon/blob/6e86a53e/johnzon-jaxrs/pom.xml
----------------------------------------------------------------------
diff --git a/johnzon-jaxrs/pom.xml b/johnzon-jaxrs/pom.xml
new file mode 100644
index 0000000..a328c08
--- /dev/null
+++ b/johnzon-jaxrs/pom.xml
@@ -0,0 +1,71 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one
+  or more contributor license agreements.  See the NOTICE file
+  distributed with this work for additional information
+  regarding copyright ownership.  The ASF licenses this file
+  to you 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.
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+  <parent>
+    <artifactId>johnzon</artifactId>
+    <groupId>org.apache.johnzon</groupId>
+    <version>1.0-SNAPSHOT</version>
+  </parent>
+  <modelVersion>4.0.0</modelVersion>
+
+  <artifactId>johnzon-jaxrs</artifactId>
+  <name>Johnzon :: JAX-RS</name>
+
+  <dependencies>
+    <dependency>
+      <groupId>javax.ws.rs</groupId>
+      <artifactId>javax.ws.rs-api</artifactId>
+      <version>2.0</version>
+      <scope>provided</scope>
+    </dependency>
+
+    <dependency>
+      <groupId>org.apache.johnzon</groupId>
+      <artifactId>johnzon-mapper</artifactId>
+      <version>${project.version}</version>
+    </dependency>
+
+    <dependency>
+      <groupId>org.apache.cxf</groupId>
+      <artifactId>cxf-rt-rs-client</artifactId>
+      <version>${cxf.version}</version>
+      <scope>test</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.cxf</groupId>
+      <artifactId>cxf-rt-frontend-jaxrs</artifactId>
+      <version>${cxf.version}</version>
+      <scope>test</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.cxf</groupId>
+      <artifactId>cxf-rt-transports-local</artifactId>
+      <version>${cxf.version}</version>
+      <scope>test</scope>
+    </dependency>
+  </dependencies>
+
+  <properties>
+    <staging.directory>${project.parent.reporting.outputDirectory}</staging.directory>
+    <cxf.version>3.0.0</cxf.version>
+  </properties>
+</project>

http://git-wip-us.apache.org/repos/asf/incubator-johnzon/blob/6e86a53e/johnzon-jaxrs/src/main/java/org/apache/johnzon/jaxrs/DelegateProvider.java
----------------------------------------------------------------------
diff --git a/johnzon-jaxrs/src/main/java/org/apache/johnzon/jaxrs/DelegateProvider.java b/johnzon-jaxrs/src/main/java/org/apache/johnzon/jaxrs/DelegateProvider.java
new file mode 100644
index 0000000..aee0790
--- /dev/null
+++ b/johnzon-jaxrs/src/main/java/org/apache/johnzon/jaxrs/DelegateProvider.java
@@ -0,0 +1,73 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you 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.
+ */
+package org.apache.johnzon.jaxrs;
+
+import javax.ws.rs.core.MediaType;
+import javax.ws.rs.core.MultivaluedMap;
+import javax.ws.rs.ext.MessageBodyReader;
+import javax.ws.rs.ext.MessageBodyWriter;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.lang.annotation.Annotation;
+import java.lang.reflect.Type;
+
+public abstract class DelegateProvider<T> implements MessageBodyWriter<T>, MessageBodyReader<T>  {
+    private final MessageBodyReader<T> reader;
+    private final MessageBodyWriter<T> writer;
+
+    protected DelegateProvider(final MessageBodyReader<T> reader, final MessageBodyWriter<T> writer) {
+        this.reader = reader;
+        this.writer = writer;
+    }
+
+    @Override
+    public boolean isReadable(final Class<?> rawType, final Type genericType,
+                              final Annotation[] annotations, final MediaType mediaType) {
+        return reader.isReadable(rawType, genericType, annotations, mediaType);
+    }
+
+    @Override
+    public T readFrom(final Class<T> rawType, final Type genericType,
+                      final Annotation[] annotations, final MediaType mediaType,
+                      final MultivaluedMap<String, String> httpHeaders,
+                      final InputStream entityStream) throws IOException {
+        return reader.readFrom(rawType, genericType, annotations, mediaType, httpHeaders, entityStream);
+    }
+
+    @Override
+    public long getSize(final T t, final Class<?> rawType, final Type genericType,
+                        final Annotation[] annotations, final MediaType mediaType) {
+        return writer.getSize(t, rawType, genericType, annotations, mediaType);
+    }
+
+    @Override
+    public boolean isWriteable(final Class<?> rawType, final Type genericType,
+                               final Annotation[] annotations, final MediaType mediaType) {
+        return writer.isWriteable(rawType, genericType, annotations, mediaType);
+    }
+
+    @Override
+    public void writeTo(final T t, final Class<?> rawType, final Type genericType,
+                        final Annotation[] annotations, final MediaType mediaType,
+                        final MultivaluedMap<String, Object> httpHeaders,
+                        final OutputStream entityStream) throws IOException {
+        writer.writeTo(t, rawType, genericType, annotations, mediaType, httpHeaders, entityStream);
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-johnzon/blob/6e86a53e/johnzon-jaxrs/src/main/java/org/apache/johnzon/jaxrs/JohnzonMessageBodyReader.java
----------------------------------------------------------------------
diff --git a/johnzon-jaxrs/src/main/java/org/apache/johnzon/jaxrs/JohnzonMessageBodyReader.java b/johnzon-jaxrs/src/main/java/org/apache/johnzon/jaxrs/JohnzonMessageBodyReader.java
new file mode 100644
index 0000000..ad55a4d
--- /dev/null
+++ b/johnzon-jaxrs/src/main/java/org/apache/johnzon/jaxrs/JohnzonMessageBodyReader.java
@@ -0,0 +1,75 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you 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.
+ */
+package org.apache.johnzon.jaxrs;
+
+import org.apache.johnzon.mapper.Mapper;
+import org.apache.johnzon.mapper.MapperBuilder;
+
+import javax.json.JsonStructure;
+import javax.ws.rs.Consumes;
+import javax.ws.rs.core.MediaType;
+import javax.ws.rs.core.MultivaluedMap;
+import javax.ws.rs.ext.MessageBodyReader;
+import javax.ws.rs.ext.Provider;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.Reader;
+import java.lang.annotation.Annotation;
+import java.lang.reflect.ParameterizedType;
+import java.lang.reflect.Type;
+import java.util.Collection;
+
+import static javax.ws.rs.core.MediaType.WILDCARD;
+import static org.apache.johnzon.jaxrs.Jsons.isJson;
+
+@Provider
+@Consumes(WILDCARD)
+public class JohnzonMessageBodyReader<T> implements MessageBodyReader<T> {
+    private final Mapper mapper;
+
+    public JohnzonMessageBodyReader() {
+        this(new MapperBuilder().setDoCloseOnStreams(false).build());
+    }
+
+    public JohnzonMessageBodyReader(final Mapper mapper) {
+        this.mapper = mapper;
+    }
+
+    @Override
+    public boolean isReadable(final Class<?> rawType, final Type genericType,
+                              final Annotation[] annotations, final MediaType mediaType) {
+        return isJson(mediaType)
+                && InputStream.class != rawType && Reader.class != rawType
+                && String.class != rawType
+                && !JsonStructure.class.isAssignableFrom(rawType);
+    }
+
+    @Override
+    public T readFrom(final Class<T> rawType, final Type genericType,
+                      final Annotation[] annotations, final MediaType mediaType,
+                      final MultivaluedMap<String, String> httpHeaders,
+                      final InputStream entityStream) throws IOException {
+        if (rawType.isArray()) {
+            return (T) mapper.readArray(entityStream, rawType.getComponentType());
+        } else if (Collection.class.isAssignableFrom(rawType) && ParameterizedType.class.isInstance(genericType)) {
+            return (T) mapper.<Collection<T>,T>readCollection(entityStream, ParameterizedType.class.cast(genericType), rawType);
+        }
+        return mapper.readObject(entityStream, genericType);
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-johnzon/blob/6e86a53e/johnzon-jaxrs/src/main/java/org/apache/johnzon/jaxrs/JohnzonMessageBodyWriter.java
----------------------------------------------------------------------
diff --git a/johnzon-jaxrs/src/main/java/org/apache/johnzon/jaxrs/JohnzonMessageBodyWriter.java b/johnzon-jaxrs/src/main/java/org/apache/johnzon/jaxrs/JohnzonMessageBodyWriter.java
new file mode 100644
index 0000000..a540d6d
--- /dev/null
+++ b/johnzon-jaxrs/src/main/java/org/apache/johnzon/jaxrs/JohnzonMessageBodyWriter.java
@@ -0,0 +1,88 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you 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.
+ */
+package org.apache.johnzon.jaxrs;
+
+import org.apache.johnzon.mapper.Mapper;
+import org.apache.johnzon.mapper.MapperBuilder;
+
+import javax.json.JsonStructure;
+import javax.ws.rs.Produces;
+import javax.ws.rs.core.MediaType;
+import javax.ws.rs.core.MultivaluedMap;
+import javax.ws.rs.core.Response;
+import javax.ws.rs.core.StreamingOutput;
+import javax.ws.rs.ext.MessageBodyWriter;
+import javax.ws.rs.ext.Provider;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.io.Writer;
+import java.lang.annotation.Annotation;
+import java.lang.reflect.ParameterizedType;
+import java.lang.reflect.Type;
+import java.util.Collection;
+
+import static javax.ws.rs.core.MediaType.WILDCARD;
+
+@Provider
+@Produces(WILDCARD)
+public class JohnzonMessageBodyWriter<T> implements MessageBodyWriter<T> {
+    private final Mapper mapper;
+
+    public JohnzonMessageBodyWriter() {
+        this(new MapperBuilder().setDoCloseOnStreams(false).build());
+    }
+
+    public JohnzonMessageBodyWriter(final Mapper mapper) {
+        this.mapper = mapper;
+    }
+
+    @Override
+    public long getSize(final T t, final Class<?> rawType, final Type genericType,
+                        final Annotation[] annotations, final MediaType mediaType) {
+        return -1;
+    }
+
+    @Override
+    public boolean isWriteable(final Class<?> rawType, final Type genericType,
+                               final Annotation[] annotations, final MediaType mediaType) {
+        return Jsons.isJson(mediaType)
+                && InputStream.class != rawType
+                && OutputStream.class != rawType
+                && Writer.class != rawType
+                && StreamingOutput.class != rawType
+                && String.class != rawType
+                && Response.class != rawType
+                && !JsonStructure.class.isAssignableFrom(rawType);
+    }
+
+    @Override
+    public void writeTo(final T t, final Class<?> rawType, final Type genericType,
+                        final Annotation[] annotations, final MediaType mediaType,
+                        final MultivaluedMap<String, Object> httpHeaders,
+                        final OutputStream entityStream) throws IOException {
+        if (rawType.isArray()) {
+            mapper.writeArray(t, entityStream);
+        } else if (Collection.class.isAssignableFrom(rawType) && ParameterizedType.class.isInstance(genericType)) {
+            mapper.writeArray(Collection.class.cast(t), entityStream);
+        } else {
+            mapper.writeObject(t, entityStream);
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-johnzon/blob/6e86a53e/johnzon-jaxrs/src/main/java/org/apache/johnzon/jaxrs/JohnzonProvider.java
----------------------------------------------------------------------
diff --git a/johnzon-jaxrs/src/main/java/org/apache/johnzon/jaxrs/JohnzonProvider.java b/johnzon-jaxrs/src/main/java/org/apache/johnzon/jaxrs/JohnzonProvider.java
new file mode 100644
index 0000000..a72e9f1
--- /dev/null
+++ b/johnzon-jaxrs/src/main/java/org/apache/johnzon/jaxrs/JohnzonProvider.java
@@ -0,0 +1,41 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you 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.
+ */
+package org.apache.johnzon.jaxrs;
+
+import org.apache.johnzon.mapper.Mapper;
+import org.apache.johnzon.mapper.MapperBuilder;
+
+import javax.ws.rs.Consumes;
+import javax.ws.rs.Produces;
+import javax.ws.rs.ext.Provider;
+
+import static javax.ws.rs.core.MediaType.WILDCARD;
+
+@Provider
+@Produces(WILDCARD)
+@Consumes(WILDCARD)
+public class JohnzonProvider<T> extends DelegateProvider<T> {
+    public JohnzonProvider(final Mapper mapper) {
+        super(new JohnzonMessageBodyReader<T>(mapper), new JohnzonMessageBodyWriter<T>(mapper));
+    }
+
+    public JohnzonProvider() {
+        this(new MapperBuilder().setDoCloseOnStreams(false).build());
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-johnzon/blob/6e86a53e/johnzon-jaxrs/src/main/java/org/apache/johnzon/jaxrs/Jsons.java
----------------------------------------------------------------------
diff --git a/johnzon-jaxrs/src/main/java/org/apache/johnzon/jaxrs/Jsons.java b/johnzon-jaxrs/src/main/java/org/apache/johnzon/jaxrs/Jsons.java
new file mode 100644
index 0000000..542347e
--- /dev/null
+++ b/johnzon-jaxrs/src/main/java/org/apache/johnzon/jaxrs/Jsons.java
@@ -0,0 +1,39 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you 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.
+ */
+package org.apache.johnzon.jaxrs;
+
+import javax.ws.rs.core.MediaType;
+
+public class Jsons {
+    public static boolean isJson(final MediaType mediaType) {
+        if (mediaType != null) {
+            final String subtype = mediaType.getSubtype();
+            return "json".equalsIgnoreCase(subtype)
+                    || "javascript".equals(subtype)
+                    || "x-json".equals(subtype)
+                    || "x-javascript".equals(subtype)
+                    || subtype.endsWith("+json");
+        }
+        return true;
+    }
+
+    private Jsons() {
+        // no-op
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-johnzon/blob/6e86a53e/johnzon-jaxrs/src/main/java/org/apache/johnzon/jaxrs/JsrMessageBodyReader.java
----------------------------------------------------------------------
diff --git a/johnzon-jaxrs/src/main/java/org/apache/johnzon/jaxrs/JsrMessageBodyReader.java b/johnzon-jaxrs/src/main/java/org/apache/johnzon/jaxrs/JsrMessageBodyReader.java
new file mode 100644
index 0000000..b4e70f7
--- /dev/null
+++ b/johnzon-jaxrs/src/main/java/org/apache/johnzon/jaxrs/JsrMessageBodyReader.java
@@ -0,0 +1,75 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you 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.
+ */
+package org.apache.johnzon.jaxrs;
+
+import javax.json.Json;
+import javax.json.JsonReader;
+import javax.json.JsonReaderFactory;
+import javax.json.JsonStructure;
+import javax.ws.rs.Consumes;
+import javax.ws.rs.WebApplicationException;
+import javax.ws.rs.core.MediaType;
+import javax.ws.rs.core.MultivaluedMap;
+import javax.ws.rs.ext.MessageBodyReader;
+import javax.ws.rs.ext.Provider;
+import java.io.IOException;
+import java.io.InputStream;
+import java.lang.annotation.Annotation;
+import java.lang.reflect.Type;
+import java.util.Collections;
+
+import static javax.ws.rs.core.MediaType.WILDCARD;
+
+@Provider
+@Consumes(WILDCARD)
+public class JsrMessageBodyReader implements MessageBodyReader<JsonStructure> {
+    private final JsonReaderFactory factory;
+    private final boolean closeStream;
+
+    public JsrMessageBodyReader() {
+        this(Json.createReaderFactory(Collections.<String, Object>emptyMap()), false);
+    }
+
+    public JsrMessageBodyReader(final JsonReaderFactory factory, final boolean closeStream) {
+        this.factory = factory;
+        this.closeStream = closeStream;
+    }
+
+    @Override
+    public boolean isReadable(final Class<?> aClass, final Type type,
+                              final Annotation[] annotations, final MediaType mediaType) {
+        return JsonStructure.class.isAssignableFrom(aClass);
+    }
+
+    @Override
+    public JsonStructure readFrom(final Class<JsonStructure> jsonStructureClass, final Type type,
+                                  final Annotation[] annotations, final MediaType mediaType,
+                                  final MultivaluedMap<String, String> stringStringMultivaluedMap,
+                                  final InputStream inputStream) throws IOException, WebApplicationException {
+        JsonReader reader = null;
+        try {
+            reader = factory.createReader(inputStream);
+            return reader.read();
+        } finally {
+            if (closeStream && reader != null) {
+                reader.close();
+            }
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-johnzon/blob/6e86a53e/johnzon-jaxrs/src/main/java/org/apache/johnzon/jaxrs/JsrMessageBodyWriter.java
----------------------------------------------------------------------
diff --git a/johnzon-jaxrs/src/main/java/org/apache/johnzon/jaxrs/JsrMessageBodyWriter.java b/johnzon-jaxrs/src/main/java/org/apache/johnzon/jaxrs/JsrMessageBodyWriter.java
new file mode 100644
index 0000000..a6acfbe
--- /dev/null
+++ b/johnzon-jaxrs/src/main/java/org/apache/johnzon/jaxrs/JsrMessageBodyWriter.java
@@ -0,0 +1,88 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you 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.
+ */
+package org.apache.johnzon.jaxrs;
+
+import javax.json.Json;
+import javax.json.JsonStructure;
+import javax.json.JsonWriter;
+import javax.json.JsonWriterFactory;
+import javax.ws.rs.Produces;
+import javax.ws.rs.WebApplicationException;
+import javax.ws.rs.core.MediaType;
+import javax.ws.rs.core.MultivaluedMap;
+import javax.ws.rs.ext.MessageBodyWriter;
+import javax.ws.rs.ext.Provider;
+import java.io.Flushable;
+import java.io.IOException;
+import java.io.OutputStream;
+import java.lang.annotation.Annotation;
+import java.lang.reflect.Type;
+import java.util.Collections;
+
+import static javax.ws.rs.core.MediaType.WILDCARD;
+
+@Provider
+@Produces(WILDCARD)
+public class JsrMessageBodyWriter implements MessageBodyWriter<JsonStructure> {
+    private final JsonWriterFactory factory;
+    private final boolean close;
+
+    public JsrMessageBodyWriter() {
+        this(Json.createWriterFactory(Collections.<String, Object>emptyMap()), false);
+    }
+
+    public JsrMessageBodyWriter(final JsonWriterFactory factory, final boolean closeStreams) {
+        this.factory = factory;
+        this.close = closeStreams;
+    }
+
+    @Override
+    public boolean isWriteable(final Class<?> aClass, final Type type,
+                               final Annotation[] annotations, final MediaType mediaType) {
+        return JsonStructure.class.isAssignableFrom(aClass);
+    }
+
+    @Override
+    public long getSize(final JsonStructure jsonStructure, final Class<?> aClass,
+                        final Type type, final Annotation[] annotations,
+                        final MediaType mediaType) {
+        return -1;
+    }
+
+    @Override
+    public void writeTo(final JsonStructure jsonStructure,
+                        final Class<?> aClass, final Type type,
+                        final Annotation[] annotations, final MediaType mediaType,
+                        final MultivaluedMap<String, Object> stringObjectMultivaluedMap,
+                        final OutputStream outputStream) throws IOException, WebApplicationException {
+        JsonWriter writer = null;
+        try {
+            writer = factory.createWriter(outputStream);
+            writer.write(jsonStructure);
+        } finally {
+            if (writer != null) {
+                if (close) {
+                    writer.close();
+                } else if (Flushable.class.isInstance(writer)) {
+                    Flushable.class.cast(writer).flush();
+                }
+            }
+        }
+    }
+}