lerist / json-smart Goto Github PK
View Code? Open in Web Editor NEWAutomatically exported from code.google.com/p/json-smart
Automatically exported from code.google.com/p/json-smart
check git on: https://code.google.com/p/json-smart.v1/ for Json-smart V1.* check git on: https://code.google.com/p/json-smart.v2/ for Json-smart V2.*
What steps will reproduce the problem?
// Note: There are two extra commas, one in the array between the int values
and one in the object where a next property is expected
JSONValue.parseStrict("{\"array\":[1,2,3,4,444,],}");
What is the expected output? What do you see instead?
In strict mode I would expect trailing commas with no subsequent properties to
throw an exception.
What version of the product are you using? On what operating system?
Java 1.6, Windows 7, json-smart from trunk as of June 13th 2011
Please provide any additional information below.
Original issue reported on code.google.com by [email protected]
on 14 Jun 2011 at 12:58
I use your excellent library in Android project. I run into issue where if I
try to pass JSONArray to the Activity by doing Intent.putExtra(String key,
Serializable array) when I try to retrieve that array doing
Intent.getSeriaizableExtra(key, null) array is converted to the plain
ArrayList. Not only that but all the nested JSONObjects are converted to
HashMaps. Currently I go around this by dumping content of JSONArray to String
and then recreating it. However that is quite memory intensive especially for
larger data sets.
Anything you would recommend?
Regards,
Bo Stone
Original issue reported on code.google.com by [email protected]
on 12 Nov 2011 at 7:27
Hi,
Sorry this is not really an issue, but I didn't find a better communication
vector.
I'm searching for a good lightweight json library and this one seem perfect for
my needs. But one thing worry me, no update since Aug 2013.
Is a new update planned or the project is dead/dormant ?
In all cases, thanks you for this project !
Original issue reported on code.google.com by [email protected]
on 3 Jun 2014 at 9:12
What steps will reproduce the problem?
1. JsonValue.parseStrict() method
2. pass string "{ \"param1\": \"value1\", \"param2\": \"value2\" }\\\\\\"
3. It should throw parser exception
What is the expected output? What do you see instead?
ParseException should be thrown but instead getting valid object
What version of the product are you using? On what operating system?
1.2
Please provide any additional information below.
Original issue reported on code.google.com by [email protected]
on 17 Jul 2014 at 6:16
Although Wiki page correctly mentions that there are multiple acceptable forms
for many things (many escapes are optional; and there are both named and
unicode escapes), tests do not seem to allow for all variants.
For example, it looks like outputting slash ('/') as is results in a fail,
whereas escaped variant ('\/') is accepted.
Original issue reported on code.google.com by [email protected]
on 21 May 2011 at 10:39
I am using the json-smart 2.1.0 JAR with another project called json-path.
json-path uses the writer functionality of json-smart, but the OSGi bundle do
not export this package so the OSGi framework fails
org.osgi.framework.BundleException: Unresolved constraint in bundle
org.apache.camel.camel-jsonpath [95]: Unable to resolve 95.0: missing
requirement [95.0] osgi.wiring.package;
(&(osgi.wiring.package=com.jayway.jsonpath)(version>=1.2.0)(!(version>=2.0.0)))
[caused by: Unable to resolve 88.0: missing requirement [88.0]
osgi.wiring.package; (osgi.wiring.package=net.minidev.json.writer)]
See ticket: https://code.google.com/p/json-path/issues/detail?id=66
The MANIFEST.MF has today
Export-Package: net.minidev.json;uses:="net.minidev.json.annotate,net.mi
nidev.asm,net.minidev.json.parser";version="2.1.0",net.minidev.json.ann
otate;version="2.1.0",net.minidev.json.parser;uses:="net.minidev.json";
version="2.1.0"
Notice that net.minidev.json.writer package is not exported. That package needs
to be added.
Original issue reported on code.google.com by [email protected]
on 30 Jan 2015 at 5:34
json-smart 1.1.1
Can I do format and how ?
Thank you.
Original issue reported on code.google.com by [email protected]
on 27 Sep 2012 at 2:09
Hi again,
As with JSON Simple I found out that here the parse error message issue exists
too.
Here is the original issue:
http://code.google.com/p/json-simple/issues/detail?id=45
Vladimir
Original issue reported on code.google.com by [email protected]
on 27 May 2011 at 9:22
See the attached file for a JUnit test that reproduces the bug.
Here's the StackTrace:
java.lang.SecurityException: Prohibited package name: java.lang
at java.lang.ClassLoader.preDefineClass(ClassLoader.java:649)
at java.lang.ClassLoader.defineClass(ClassLoader.java:785)
at java.lang.ClassLoader.defineClass(ClassLoader.java:634)
at net.minidev.asm.DynamicClassLoader.defineClass(DynamicClassLoader.java:86)
at net.minidev.asm.BeansAccessBuilder.bulid(BeansAccessBuilder.java:313)
at net.minidev.asm.BeansAccess.get(BeansAccess.java:105)
at net.minidev.json.mapper.BeansMapper$Bean.<init>(BeansMapper.java:40)
at net.minidev.json.mapper.Mapper.getMapper(Mapper.java:105)
at net.minidev.json.mapper.Mapper.getMapper(Mapper.java:75)
at net.minidev.json.mapper.BeansMapper$Bean.startObject(BeansMapper.java:83)
at net.minidev.json.parser.JSONParserBase.readMain(JSONParserBase.java:387)
at net.minidev.json.parser.JSONParserBase.readObject(JSONParserBase.java:530)
at net.minidev.json.parser.JSONParserBase.readFirst(JSONParserBase.java:285)
at net.minidev.json.parser.JSONParserBase.parse(JSONParserBase.java:150)
at net.minidev.json.parser.JSONParserString.parse(JSONParserString.java:57)
at net.minidev.json.parser.JSONParser.parse(JSONParser.java:253)
at net.minidev.json.JSONValue.parse(JSONValue.java:210)
at JsonSmartTest.doTest(JsonSmartTest.java:17)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44)
at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:271)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:70)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229)
at org.junit.runners.ParentRunner.run(ParentRunner.java:309)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50)
at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
I suppose you're not type-guessing. I would expect "obj" to be recognized as a
json hash and so be decoded as a generic Map<String, Object>
Original issue reported on code.google.com by [email protected]
on 21 Jan 2014 at 10:52
Attachments:
The following code exists in both v1 and v2 of JSONStyle.java:
_protectKeys = (FLAG & FLAG_PROTECT_KEYS) == 0;
_protectValues = (FLAG & FLAG_PROTECT_VALUES) == 0;
_protect4Web = (FLAG & FLAG_PROTECT_4WEB) == 0;
Presumably this is meant to check that FLAG is set, and that (e.g.) it contains
the FLAG_PROTECT_4WEB flag. Except that by comparing to zero, you're doing the
opposite of what you want. You should be comparing to "> 0" not "== 0" (like
you do a few lines below that with the FLAG_AGRESSIVE check).
Anyway, this has the unfortunate effect of making it impossible to use any of
the "protect" features.
Attached diff should fix the issue for v1.
Original issue reported on code.google.com by [email protected]
on 22 Mar 2012 at 10:56
Attachments:
ParseException
(https://code.google.com/p/json-smart/source/browse/json-smart/src/main/java/net
/minidev/json/parser/ParseException.java?repo=v1&r=28a655898c1e66357c89697078b84
3bf87249bcb) contains the misspelled word "secance". Likely fix is "sequence".
Original issue reported on code.google.com by [email protected]
on 11 Nov 2013 at 6:00
Right now the ParseException's 'toString' method is overridden. Which
leaves the get[Localized]Message methods returning NULL.
This bug is very annoying because it breaks standard error-handling code,
due to:
1. It breaks the typical exception.toString() implementation not to report its
name first
(this is the most disturbing).
2. The exception does not have an exception-message at all.
Obviously the bug was copied from json-simple, see respective issue-5 there.
What steps will reproduce the problem?
1. Capture any net.minidev.json.parser.ParseException.
2. The 'getMessage' or 'getLocalizedMessage' return NULL (although there is a
message returned by toString)
4. The toString() does not report exception-name.
VERSION: 1.1.1, module: v1 (have not checked v2)
FIX
---
Please,
a) move the code from ParseException.toString() to ParseException.getMessage(),
and
b) stop overridding toString() method.
Original issue reported on code.google.com by [email protected]
on 11 Apr 2013 at 6:29
What steps will reproduce the problem?
1. defined super class with protected properties.
2. defined sub class inherited from super
3. output the sub info . But it doesnot any inherited properties.
What is the expected output? What do you see instead?
I wanna see the protected properties in sub class.
What version of the product are you using? On what operating system?
json-smart 1.0.9-1
win7 and centos5 . x64
Please provide any additional information below.
contact by gmail . I need eagerly.
Thank you!
Original issue reported on code.google.com by [email protected]
on 18 Apr 2012 at 10:00
I cloned json-smart but the clone only had these these files:
/v1
/v2
/wiki
readme.txt
The dirs are empty. I looked through the other clones and found a few that
looked messed up like mine.
any ideas?
Original issue reported on code.google.com by [email protected]
on 15 May 2013 at 9:57
I'm using this in conjunction with JsonPath and I have been debugging my
problem for a while. The issue is that the order I get the keys back changes
between generation of the JSON and parsing of the JSON as the JSONObject is
backed by a HashMap. Hence if I build a structure, serialize and deserialize,
I don't actually have the same structure.
Original issue reported on code.google.com by [email protected]
on 1 Mar 2013 at 12:32
Hi,
your project is really interesting as JSON-SIMPLE is quite stagnant but I must use JDK 1.4.2... and json-smart looks like it is not compatible. Am I wrong? Any plan to support older JVM?
Thanks
Bye
Piero
Original issue reported on code.google.com by [email protected]
on 10 Aug 2011 at 2:06
Hi,
it would be really nice to improve the generics of JSONArray static methods.
A fix "List<Object>" is very unflexible at this point, and leads always to
casts.
List<? extends Object> would be a much better Api.
See for further details:
http://en.wikipedia.org/wiki/Wildcard_%28Java%29#Example:_Lists
Regards
Original issue reported on code.google.com by [email protected]
on 12 Jul 2011 at 7:06
What steps will reproduce the problem?
1. Create a JSONParser with any mode.
2. jsonParser.parse("[1]1");
3. No exceptions are thrown.
What is the expected output? What do you see instead?
Some exception indicating that there are trailing characters.
What version of the product are you using? On what operating system?
1.0.9-1
Please provide any additional information below.
In
http://code.google.com/p/json-smart/source/browse/1.0.X/json-smart/src/main/java
/net/minidev/json/parser/JSONStreamParser.java
readMain() simply does "return readArray();" for example. It would need to do
the readArray() but then check for additional non-whitespace and throw an error
if it is found.
Original issue reported on code.google.com by [email protected]
on 7 Dec 2011 at 4:29
The source code to reproduce a problem:
@Test
public void testJSON() {
JSONObject object = new JSONObject();
object.put("///////", "//////");
System.out.println(object.toJSONString());
}
Expected output:
{"\/\/\/\/\/\/\/":"\/\/\/\/\/\/"}
{"///////":"//////"}
I tried both 1.0.9 and 2.0.0-alpha1 versions, and the json-smart always escaped
the "/" symbol. Isn't this pointless? Thanks.
Original issue reported on code.google.com by [email protected]
on 19 Sep 2011 at 6:46
What steps will reproduce the problem?
1. JavaBean , boolean isPopping
2. json-smart outputs
3.
What is the expected output? What do you see instead?
Just like Eclipse IDE generates codes.
public boolean isPopping() {
return isPopping;
}
What version of the product are you using? On what operating system?
json-smart-1.1.1
Please provide any additional information below.
Original issue reported on code.google.com by [email protected]
on 5 Jun 2012 at 8:24
What steps will reproduce the problem?
JSONValue.parseStrict({"name":0000123});
What is the expected output? What do you see instead?
The RFC 4627 specifies that leading zeroes are not permitted. (2.4 - Leading
zeros are not allowed.) It should result into an exception.
What version of the product are you using? On what operating system?
Windows 7, Java 1.6
Please provide any additional information below.
Original issue reported on code.google.com by [email protected]
on 14 Jun 2011 at 12:30
Hello,
I would like to request a user guide or some examples of setting up json-smart
with various file i/o operations (including file streams or alternate streams).
Thank you,
Jaya
Original issue reported on code.google.com by [email protected]
on 24 Jul 2012 at 4:02
What steps will reproduce the problem?
1. BigDecimal serialization is not supported
2.
3.
What is the expected output? What do you see instead?
blank output
What version of the product are you using? On what operating system?
1.3.1
Please provide any additional information below.
BigDecimal.class should be added to registerWriter as part of Number writer
registration in init function of JsonWriter class.
Original issue reported on code.google.com by [email protected]
on 22 Oct 2014 at 8:55
Hello,
will be nice to be able to configure some options for this feature ala gson.
on gson lib, you are able to
1) write custom serializer (can be done imps JSONAware so its ok)
2) write custom exclusion strategy: method get invoked per each field, and must
return true/false to skip/keep the field ie:
private class MyExclusionStrategy implements ExclusionStrategy {
public boolean shouldSkipClass(Class<?> clazz) {
return false;
}
public boolean shouldSkipField(FieldAttributes f) {
String cn = (f.getDeclaringClass().getCanonicalName() + '.' + f.getName());
for (String s : skip)
if (cn.contains(s)) return true;
return false;
}
}
in this way, we can build a macro serializer object, that can be configured
on-the-fly with unwanted fields.
3) probably the most important feature, be able to serializer
private/protected/transient fields (and toggle between them). on GSON by
default, you get the full load of all fields per each class, then you can
.excludeFieldsWithModifiers(java.lang.reflect.Modifier.TRANSIENT)
to remove some modifiers from the serialization. This will add a great value
imho, sometimes is useful to serialize private/package_protected fields
(transient should be keep off, the meaning of transient is exactly 'don't
serialize it please') but, if you think about keep the state of a bean, a
private VAR must be serialized for sure
Original issue reported on code.google.com by [email protected]
on 23 Nov 2012 at 2:57
OSGi Bundles are jars with some extra meta-data in the manifest file. This
data is easily added with the apache felix bundle plugin.
To fix, make the following changes to your pom:
1. Change <packaging> to 'bundle' (it's now 'jar'). This will still generate a
JAR file that works in other situations, but also includes metadata that OSGi
needs.
2. Add this plugin to your build section:
<build>
<plugins>
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<extensions>true</extensions>
</plugin>
</plugins>
</build>
That's it! Easy. And all of us who use OSGi for our deployment engine will
love you unreservedly, buy you a beer when we see you and think warmly you on a
regular basis.
Original issue reported on code.google.com by [email protected]
on 29 Feb 2012 at 8:54
What steps will reproduce the problem?
1. Create JSONParser with mode as RFC4627
2. try to parse string "{ \"param1\'\': value1, \"param2\": \"value2\" }" which
invalid format
What is the expected output? What do you see instead?
It should throw exception, instead it's getting parsed as valid
What version of the product are you using? On what operating system?
1.1.1
Please provide any additional information below.
Original issue reported on code.google.com by [email protected]
on 10 Jul 2014 at 10:51
What steps will reproduce the problem?
JSONValue.parseStrict("{\"name\":123, \"name\":123}");
What is the expected output? What do you see instead?
As per RFC 4627, duplicate names are not allowed. (2.2 ... The names within an
object SHOULD be unique.). An error should occur.
What version of the product are you using? On what operating system?
Java 1.6, Windows 7, Trunk as of June 13th 2011
Please provide any additional information below.
Original issue reported on code.google.com by [email protected]
on 14 Jun 2011 at 12:32
can we please change a small line of code here?
JStylerObj.java
public void escape(String s, Appendable sb) {
try {
for (int i = 0; i < s.length(); i++) {
}
}
}
can we replace s.lenght() with int l = s.length() and use this var?
i think that there will be a little improve of performance, will avoid the
continuous call to an external object method
Original issue reported on code.google.com by [email protected]
on 28 Nov 2012 at 1:27
What steps will reproduce the problem?
1. Execute this code
String test =
"[{\"key\":\"value\",\"newKey\":[{\"\"tabKey\":[\"tab1\",\"tab2\"]}]}]";
System.out.println(JSONValue.isValidJson(test));
System.out.println(JSONValue.isValidJsonStrict(test));
JSONParser parser = new JSONParser(JSONParser.MODE_RFC4627);
System.out.println("MODE_RFC4627 : " + parser.parse(test));
parser = new JSONParser(JSONParser.MODE_STRICTEST);
System.out.println("MODE_STRICTEST : " + parser.parse(test));
parser = new JSONParser(JSONParser.MODE_JSON_SIMPLE);
System.out.println("MODE_JSON_SIMPLE : " + parser.parse(test));
parser = new JSONParser(JSONParser.MODE_PERMISSIVE);
System.out.println("MODE_PERMISSIVE : " + parser.parse(test));
What is the expected output? What do you see instead?
An exception should be thrown somewhere and I think both methods isValidJson()
and isValidJsonStrict() should return false.
This is the output:
true
true
MODE_RFC4627 : [{"newKey":[{"":["tab1","tab2"]}],"key":"value"}]
MODE_STRICTEST : [{"newKey":[{"":["tab1","tab2"]}],"key":"value"}]
MODE_JSON_SIMPLE : [{"newKey":[{"":["tab1","tab2"]}],"key":"value"}]
MODE_PERMISSIVE : [{"newKey":[{"":["tab1","tab2"]}],"key":"value"}]
As you can see, tabKey does not appear, just nothing instead.
When I put ""tabKey" in the string, nothing appear, if I put "tabKey"", it
works normally (tabKey appears). But in both case, we should have false, false
+ exception.
What version of the product are you using? On what operating system?
Version 1.1.1 / Win7
Please provide any additional information below.
Original issue reported on code.google.com by [email protected]
on 28 Jun 2013 at 8:58
When executing the following code
out = new FileWriter(new File("/sdcard/foo"));
((JSONObject) value).writeJSONString(out, JSONStyle.MAX_COMPRESS);
I get this stacktrace:
Failed to write object to SD: Member
java.util.ConcurrentModificationException
java.util.HashMap$HashIterator.nextEntry(HashMap.java:792)
java.util.HashMap$EntryIterator.next(HashMap.java:829)
java.util.HashMap$EntryIterator.next(HashMap.java:827)
04-09 17:20:04.786: E/com.flud.util.JsonUtils(537): at
net.minidev.json.JSONObject.writeJSONString(JSONObject.java:191)
This seems to only happen for JSONObject but not for JSONArray. I'm using v.
1.1.1 on Android
Original issue reported on code.google.com by [email protected]
on 9 Apr 2012 at 5:28
Parsing the following incomplete JSON strings throws an unexpected
StringIndexOutOfBoundsException instead of a regular ParseException.
{"key":{}
{"key":
{"key":123
java.lang.StringIndexOutOfBoundsException: String index out of range: 10
at java.lang.String.substring(String.java:1946)
at net.minidev.json.parser.JSONParser.readNQString(JSONParser.java:216)
at net.minidev.json.parser.JSONParser.readObject(JSONParser.java:341)
at net.minidev.json.parser.JSONParser.readMain(JSONParser.java:132)
at net.minidev.json.parser.JSONParser.parse(JSONParser.java:54)
at net.minidev.json.JSONValue.parseWithException(JSONValue.java:183)
at TestParseError.main(TestParseError.java:12)
Observed in JSON Smart 1.0.9.
See Java attachment for test case.
Original issue reported on code.google.com by [email protected]
on 14 Oct 2011 at 10:50
Attachments:
version used: 1.0.9
new JSONParser(JSONParser.MODE_RFC4627).parse("{\"1\":\"one\"\"2\":\"two\"}")
the above line throws parse exception; where as following line doesn't:
new JSONParser(JSONParser.MODE_RFC4627).parse("{\"1\":\"one\"\n\"2\":\"two\"}")
note that inserting \n makes it parsed successfully
Original issue reported on code.google.com by [email protected]
on 22 Oct 2011 at 7:30
The thread-safe StringBuffer class is used throughout the project
but most references are for local variables,
hence it can be safely replaced by the StringBuilder,
as suggested by the JDK javadocs.
VERSION:
module(v1), svn(1459912)
Original issue reported on code.google.com by [email protected]
on 12 Apr 2013 at 3:04
I am de-/serializing Java objects using JSON. The objects often contain a UUID
identifier generated by a database or Java code. If using max compression if
the UUID "looks" like a floating point number the parser generates wrong values.
Test code:
JSONArray array = (JSONArray) JSONValue.parse(json);
array.get(0).toString()
With MAX_COMPRESSION (uuid_child value is wrong)
Input JSON:
[{uuid_child:58860611416142319131902418361e88,uuid_parent:563a5570932e409e9621e1
8e5a17d6a5}]
Parsed JSON:
{"uuid_child":5.8860611416142319131902418361E+116,"uuid_parent":"563a5570932e409
e9621e18e5a17d6a5"}
With LT_COMPRESS works:
Input JSON:
[{"uuid_child":"58860611416142319131902418361e88","uuid_parent":"563a5570932e409
e9621e18e5a17d6a5"}]
Parsed JSON:
{"uuid_child":"58860611416142319131902418361e88","uuid_parent":"563a5570932e409e
9621e18e5a17d6a5"}902418361e88","uuid_parent":"563a5570932e409e9621e18e5a17d6a5"
}
This happens with the current stable release json-smart-1.2. Haven't tested
other versions by now.
Original issue reported on code.google.com by [email protected]
on 19 Feb 2014 at 11:37
Some webservices provide JSON with ascii hex excape sequences in them.
json-smart should support this...
What steps will reproduce the problem?
1. Attempt to parse some JSON which contains an ASCII hex excape sequence like
\x27
2.
3.
What is the expected output? What do you see instead?
\x27 should be parsed as '
What version of the product are you using? On what operating system?
V1.1.1
Please provide any additional information below.
I made the following changes to support ascii hex excape sequences...
In JSONParserBase:
In readString2()
case 'u':
sb.append(readUnicode());
case 'x'://<--- Added line
sb.append(readAsciHexExcapeCode());//<--- Added line
protected char readAsciHexExcapeCode() throws IOException, ParseException
{
return readUnicode(2);
}
protected char readUnicode() throws ParseException, IOException {
return readUnicode(4);
}
protected char readUnicode(int totalChars) throws IOException, ParseException
{
int value = 0;
for (int i = 0; i < totalChars; i++) {
value = value * 16;
read();
if (c <= '9' && c >= '0')
value += c - '0';
else if (c <= 'F' && c >= 'A')
value += (c - 'A') + 10;
else if (c >= 'a' && c <= 'f')
value += (c - 'a') + 10;
else if (c == EOI)
throw new ParseException(pos, ERROR_UNEXPECTED_EOF, "EOF");
else
throw new ParseException(pos, ERROR_UNEXPECTED_UNICODE, c);
}
return (char) value;
}
Original issue reported on code.google.com by [email protected]
on 8 May 2013 at 6:14
What steps will reproduce the problem?
1. {"something":[]}
What is the expected output? What do you see instead?
The JSON string is deemed invalid in strict. Shouldn't an empty array be valid?
What version of the product are you using? On what operating system?
1.0.8, Windows 7, JDK 1.6
Please provide any additional information below.
Original issue reported on code.google.com by [email protected]
on 1 Jul 2011 at 5:56
Using this code:
JSONObject resultObject = new JSONObject();
resultObject.put("intArray", new int[]{1, 2, 50, 1234, 10000});
System.out.println("RESULT: " + resultObject.toJSONString());
The output is:
RESULT: {"intArray":[1,2,05,4321,00001]}
I'm using json-smart-1.1.jar
Original issue reported on code.google.com by [email protected]
on 16 Mar 2012 at 5:27
1. feature like jackson ObjectMapper.updatevalue,that is: update object from
json,no new instance create.
thanks
Original issue reported on code.google.com by [email protected]
on 13 Oct 2011 at 5:42
Hi Uriel,
My name is Vladimir and I'm the maintainer of the JSON-RPC 2.0 Base library. It
has traditionally used JSON simple for parsing. A user however suggested I look
at your implementation. I must say the benchmarks look impressive, at least on
paper. Good work!
What worries me is that your parser allows for a very wide set of input whereas
I would prefer to receive a parse exception if the text doesn't comform to
standard JSON as per RFC 4627. Would you consider adding a parse method with a
"strict" option? For example:
JSONValue.parse(String s, boolean strict)
JSONParser.parse(String s, boolean strict)
etc...
Original issue reported on code.google.com by [email protected]
on 16 May 2011 at 9:31
There's a small bug in Jackson test in that it does not actually set 'obj'
after parsing array value. Additionally while node.toString() should usually
work, more correct method is to use mapper (there are some edge cases where two
differ). This patch fixes these issues, so that 3 more tests pass for Jackson.
Original issue reported on code.google.com by [email protected]
on 21 May 2011 at 10:37
Attachments:
What steps will reproduce the problem?
1. Follow the instructions on http://code.google.com/p/json-smart/ for Maven
What is the expected output? What do you see instead?
The JAR cannot be found in the Maven repo.
Please provide any additional information below.
1.0.9.1 should be 1.0.9-1 ala
http://search.maven.org/remotecontent?filepath=net/minidev/json-smart/1.0.9-1/js
on-smart-1.0.9-1.pom
Original issue reported on code.google.com by [email protected]
on 7 Dec 2011 at 4:07
Hi,
Regarding the JSON parser constant for non-strict parsing, wouldn't it make
more sense to use an English word for it, i.e. MODE_PERMISSIVE instead of the
current MODE_PERMISSIF?
Regards,
Vladimir
Original issue reported on code.google.com by [email protected]
on 27 May 2011 at 9:02
What steps will reproduce the problem?
1.
2.
3.
What is the expected output? What do you see instead?
What version of the product are you using? On what operating system?
Please provide any additional information below.
Original issue reported on code.google.com by [email protected]
on 27 Sep 2012 at 3:25
Can add a method in JSONValue defined as follows:
public static Object parse(byte[] in, int beginIndex, int endIndex);
beginIndex - the beginning index, inclusive.
endIndex - the ending index, exclusive.
It can brings great performance improvements for my program.
Original issue reported on code.google.com by [email protected]
on 11 May 2012 at 2:13
1. like @JsonIgnore of jackson, in case to ignore some feild.
2. set JSONStyle config to different class of so.
3. and so on.
json-smart will be more powerful.Thanks.
Original issue reported on code.google.com by [email protected]
on 1 Oct 2011 at 5:58
parsing a string or stream with only "123":
java.lang.ArrayIndexOutOfBoundsException: -1
at net.minidev.json.parser.JSONStreamParser.readNumber(JSONStreamParser.java:247)
at net.minidev.json.parser.JSONStreamParser.readMain(JSONStreamParser.java:221)
at net.minidev.json.parser.JSONStreamParser.parse(JSONStreamParser.java:75)
at net.minidev.json.parser.JSONStreamParser.parse(JSONStreamParser.java:50)
at net.minidev.json.parser.JSONParser.parse(JSONParser.java:147)
The error is different for a string than for a stream.
It should return an integer 123
json-smart 1.0.9 maven
Please provide any additional information below.
Original issue reported on code.google.com by [email protected]
on 23 Oct 2011 at 2:54
This is a feature request.
Sometimes you want to use a json object as a configuration file, or you just
want to write it to disk to examine it. It would be nice to have a new
JSONStyle.VERBOSE for use in JSONObject.toJSONString() that would add full line
breaks after each name/value pair, and before and after braces. The benefit is
that the JSON strings would be easier for humans to read.
The style used in http://jsonlint.com/ is a good one.
Original issue reported on code.google.com by [email protected]
on 10 Dec 2012 at 8:52
If data resultset from database by ordered, json outputed info is ordered??
Original issue reported on code.google.com by [email protected]
on 3 Feb 2012 at 8:48
just a simple enhancement to reduce json object size:
{key1,key2:value2,key3:{key31:value31,key32}}
== {key1:null,key2:value2,key3:{key31:value31,key32:null}}
Original issue reported on code.google.com by [email protected]
on 28 Aug 2012 at 4:48
What steps will reproduce the problem?
// Note that the testJsonString includes unicode characters and is UTF-8 endoded
String testJsonString =
"{\"balance\":1000.21,\"num\":100,\"nickname\":null,\"is_vip\":true,\"Sinhalese\
":\"සිංහල ජාතිය\",\"name\":\"foo\"}";
ByteArrayInputStream bis = new
ByteArrayInputStream(testJsonString.getBytes(StandardCharsets.UTF_8));
JSONObject obj = JSONValue.parse(bis, JSONObject.class);
obj.get("Sinhalese"); // result is incorrect
What is the expected output? What do you see instead?
I would expect obj.get("Sinhalese") to return the characters in the original
UTF-8 String
What version of the product are you using? On what operating system?
Using json-smart 2.0, openjdk 7 on freebsd
Please provide any additional information below.
Note that:
JSONValue.parse(ByteStreams.toByteArray(bis), JSONObject.class);
works correctly. So the code works fine when decoding byte arrays
Original issue reported on code.google.com by [email protected]
on 13 Sep 2014 at 6:42
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.