GRIDAPPSD / gridappsd-forum

This repo is for GridAPPS-D users to ask questions and report issues.
4 stars 0 forks source link

API call to "Request GridLAB-D Base File" returns invalid json #19

Open blthayer opened 5 years ago

blthayer commented 5 years ago

Description of Issue

When using the Python API to get a GridLAB-D model, it appears invalid json is returned.

Topic

goss.gridappsd.process.request.config

Request json

{"configurationType": "GridLAB-D Base GLM", "parameters": {"model_id": "_4F76A5F9-271D-9EB8-5E31-AA362D86F2C3"}}

Response (invalid json, first and last 50 characters)

NOTE: The ... below is intended to be an ellipse - I'm not going to put the entire GridLAB-D model string in here.

{"data":object regulator_configuration {\n  name "r'...09;\n}\n,"responseComplete":true,"id":"1968490638"}

Hypothesis

I'm guessing the issue is a lack of escaping special characters like "

blthayer commented 5 years ago

Adding comments from original issue:

@poorva1209 - assigning to you since you're the primary point of contact :)

@blthayer GridLAB-D base is inherently not JSON. Do you want model file in gridlab-d format just a json format ?

@poorva1209 - sorry I didn't see this, something must be wrong with my Github notifications.

I don't have strong feelings about the file type, but the way it is now you have to "hack around it" so to speak.

@poorva1209, @craig8, @afisher1 - I just wanted to bring this to your attention. While this isn't a big deal, you currently have to use regular expressions to fix the broken/bad json return.

From the application developer perspective, receiving the model as a big string would be A-okay. Escaping all the special characters to fit it into a json message sounds gross.