GSA / auctions_api

An API for GSA auctions data.
http://gsa.github.io/auctions_api
The Unlicense
3 stars 8 forks source link

Syntax errors in JSON #22

Open alishalisha opened 9 years ago

alishalisha commented 9 years ago

Hi, I ran the raw JSON file through a JSON validator and found multiple syntax errors. I am going through them one by one and fixing, but was wondering if anyone else found the same issue + was unable to use the API for this reason? I'm a noob at making data requests from APIs, so go easy on me. :)

If/after I am done fixing the syntax errors, I can post the resulting JSON file here. The most common problem has been double quotes within double quotes. :(

kishoregh commented 9 years ago

Hello:

Can you let me know how you are validating the JSON file? There are browser extensions to open json file, but I can't go that route yet due to security issue. I haven't found a site where I can point the file so that it will validate the entire file. If you know the site, please let me know otherwise let me know where you are getting syntax errors ( sale and lot numbers can help me pin point the record). Thank you,

On Mon, Nov 3, 2014 at 8:11 PM, Alisha Ramos notifications@github.com wrote:

Hi, I ran the raw JSON file through a JSON validator and found multiple syntax errors. I am going through them one by one and fixing, but was wondering if anyone else found the same issue + was unable to use the API for this reason? I'm a noob at making data requests from APIs, so go easy on me. :)

If/after I am done fixing the syntax errors, I can post the resulting JSON file here. The most common problem has been double quotes within double quotes. :(

— Reply to this email directly or view it on GitHub https://github.com/GSA/auctions_api/issues/22.

johnlyn763 commented 9 years ago

I don't know if this is the same one being used by alisha, but I've used JSON formatter heavily in the past for this: http://jsonformatter.curiousconcept.com/

joannalaine commented 8 years ago

I am also having the same problem. In the following record, there are quotes within the 'Instruction1' value. This happens in a number of the records. Can you escape or encode these quotes before generating the JSON? { "SaleNo ":"71QSCI16071", "LotNo ": 2, "AucStartDt ":"2015-11-17", "AucEndDt ":"2015-11-24", "ItemName ":"DRY DUPLICATOR", "PropertyAddr1 ":"National Science Foundation", "PropertyAddr2 ":"3010 Coronal Loop", "PropertyAddr3 ":"", "PropertyCity ":"Sunspot", "PropertyState ":"NM", "PropertyZip ":"883490000", "AuctionStatus ":"A", "SaleLocation ":"GSA, FAS, PPM (9QSCC)", "LocationOrg ":"Sales Office, 2nd Floor", "LocationStAddr ":"50 United Nations Plaza", "LocationCity ":"San Francisco", "LocationST ":"CA", "LocationZip ":"941024912", "BiddersCount ": 0, "LotInfo":[ {"LotSequence":"001", "LotDescript":"Dry\u0020Duplicator\u0020printer\u003B\u0020model\u002047000\u003B\u0020Qty\u00201\u0020ea\u003B"}, {"LotSequence":"002", "LotDescript":"\u00284994AB53141001\u0029\u0020Salvage\u0020Condition\u002E"}, {"LotSequence":"003", "LotDescript":"4994AB53141001"} ], "Instruction1 ":""PAYMENT DUE BY 11/27/15, REMOVE BY 12/09/15"", "Instruction2 ":"INSPECTION AND REMOVAL BY APPOINTMENT ONLY", "Instruction3 ":"PLEASE PAY AND REMOVE PROMPTLY", "ContractOfficer":"TERESA ZUBER", "COEmail ":"teresa.zuber@gsa.gov", "COPhone ":"8178508153", "Reserve ":false, "AucIncrement ": 10.00, "HighBidAmount ": 0.00, "InactivityTime ": 10, "AgencyCode ":"

nashguy commented 5 years ago

There still are problems in the json that's being generated.

This line in the file that I downloaded today exemplifies the problem. Opening the file in Visual Studio Code on the Mac highlights the line(s) in error. This is line 39, in the first record.

  "Instruction2   ":"///PAYMENT DUE BY 05-24-19 & REMOVAL BY 06-06-19\\\",

The closing slashes seem to be the problem. It's as though they're inappropriately escaping other characters. MS Code says "Unexpected end of string. json(258)

If you remove the slashes, the line is fine. Every "Instruction2" line that ends with these slashes is flagged as invalid JSON. In the file I have, there appear to be 59 lines with that problem. The last is on line 2866.

There are also errors being raised for the AgencyCode and BureauCode fields, saying that there are invalid characters in the string, that control characters must be escaped. json(262) This problem seems to occur in almost every record.

s2j1968 commented 3 years ago

"Instruction2 ":"///PAYMENT DUE BY 05-24-19 & REMOVAL BY 06-06-19\\",

I can confirm that this is still a problem. Also, confirm the two fields with invalid characters instead of empty strings as intended. "AgencyCode", "BureauCode"

ddgflorida commented 3 years ago

I reported the same problems as above plus a few others. They are not escaping any special characters like backslash and double quote. The keys have spaces in them. There are control characters (NUL, SUB) embedded in the data. Since this issue has been around for multiple years, it would appear that they just don't care or incompetent.