Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Resolves #1766 #1773

Merged
merged 3 commits into from
Apr 25, 2024
Merged

Resolves #1766 #1773

merged 3 commits into from
Apr 25, 2024

Conversation

poorva1209
Copy link
Contributor

To test GLM:

request = {
    "configurationType": "GridLAB-D Base GLM",
    "parameters": {
        "model_id": "_C1C3E687-6FFD-C753-582B-632A27E28507",
    }
}
response = gapps.get_response('goss.gridappsd.process.request.config', request)
json_object = json.loads(response, strict=False)
print(json_object['data'])

To Test DSS:

request = {
    "configurationType": "DSS Base",
    "parameters": {
        "model_id": "_C1C3E687-6FFD-C753-582B-632A27E28507",
    }
}
response = gapps.get_response('goss.gridappsd.process.request.config', request)
json_object = json.loads(response, strict=False)
print(json_object['data'])

@poorva1209 poorva1209 requested a review from afisher1 April 11, 2024 16:32
@poorva1209 poorva1209 linked an issue Apr 11, 2024 that may be closed by this pull request
@afisher1
Copy link
Contributor

@poorva1209 I get a TypeError trying to perform json.loads(response).

The response is already a dictionary. What needs to happen is that the contents of response['message'] needs to be json serializable. which it seems to be but on closer look escaped characters like \n and \t need to be \n and \t so when I try to do a json.loads(response['message']) that fails.

@poorva1209
Copy link
Contributor Author

poorva1209 commented Apr 19, 2024

@afisher1 Look at the examples in the PR description. it needs to be json_object = json.loads(response, strict=False)

@afisher1 afisher1 merged commit 2981889 into GRIDAPPSD:develop Apr 25, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Base Dss and GLM doesnt return valid json response
2 participants