Campoie / rest-assured

Automatically exported from code.google.com/p/rest-assured
0 stars 0 forks source link

JSON names which cosist of digits separated by dots cannot be processed #195

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. JSON output: {"foo.bar": {"0.2.0": "test"}}
2. REST-assured code example: 
get("/rest").jsonPath().get("'foo.bar'.'0.2.0'").toString();
3. Error: No signature of method: java.util.HashMap.0.() is applicable for 
argument types: (java.lang.Integer) values: [2]

What is the expected output? What do you see instead?
"test" value should be returned.

What version of the product are you using? On what operating system?
1.6.2

Please provide any additional information below.

Original issue reported on code.google.com by gamler.m...@tut.by on 27 Aug 2012 at 1:14

GoogleCodeExporter commented 9 years ago
I've now (hopefully) fixed this in trunk. Please validate it by depending on 
1.6.3-SNAPSHOT after having added the following maven repo:

<repositories>
        <repository>
            <id>sonatype</id>
            <url>https://oss.sonatype.org/content/repositories/snapshots/</url>
            <snapshots />
        </repository>
</repositories>

Original comment by johan.ha...@gmail.com on 28 Aug 2012 at 6:32

GoogleCodeExporter commented 9 years ago

Original comment by johan.ha...@gmail.com on 28 Aug 2012 at 6:32

GoogleCodeExporter commented 9 years ago
Unfortunately, I'm currently getting the following error: "Failed to parse the 
Object document"
The error occurs even if I try to get only the first item 'foo.bar'(but it 
works for 1.6.2). 

Original comment by gamler.m...@tut.by on 28 Aug 2012 at 7:47

GoogleCodeExporter commented 9 years ago
Can you provide the JSON where you get this error?

Original comment by johan.ha...@gmail.com on 28 Aug 2012 at 8:51

GoogleCodeExporter commented 9 years ago
Looks like the issue is reproducible for any JSON.
This one for example:

baseURI = "https://www.googleapis.com";
port = 80;
String n = 
get("/plus/v1/people?key=AIzaSyCXW3uoEp3WpBj2mBSyop6OCLsOb80gN-I&query=Anna&lang
uage=en").jsonPath().get("etag").toString();

Original comment by gamler.m...@tut.by on 28 Aug 2012 at 10:44

GoogleCodeExporter commented 9 years ago
But how does the JSON document looks like that you get back from the server?

Original comment by johan.ha...@gmail.com on 28 Aug 2012 at 10:45

GoogleCodeExporter commented 9 years ago
attached

Original comment by gamler.m...@tut.by on 28 Aug 2012 at 10:55

Attachments:

GoogleCodeExporter commented 9 years ago
Little clarification.

By "the issue is reproducible for any JSON" I've meant NOT the initial issue 
195, but the error "Failed to parse the Object document", which indicates that 
some basic mechanism was broken during the fix. 

If you need the initial JSON to reproduce the issue 195, here it is:
{"some.people-web": {"0.1.0": {"pub": {"$meta.json": {"dependencies": 
["one","two","three"]}}}}}
and the code to parse it:
get("/rest").jsonPath().get("'some.people-web'.'0.1.0'").toString();

Sorry for misleading.

Original comment by gamler.m...@tut.by on 28 Aug 2012 at 11:14