DeployHubProject / DeployHub-Pro

DeployHub Pro Pipeline Status Project
https://www.openmakesoftware.com/application-release-automation-for-continuous-delivery/
Other
11 stars 4 forks source link

json parser failing on valid json #232

Open sbtaylor15 opened 6 years ago

sbtaylor15 commented 6 years ago

{"server": {"status": "BUILD", "updated": "2017-12-07T22:23:57Z", "hostId": "", "addresses": {}, "links": [{"href": "https://dfw.servers.api.rackspacecloud.com/v2/1025100/servers/0c3c0349-3c7b-4c3b-8c8a-3706e9b8257c", "rel": "self"}, {"href": "https://dfw.servers.api.rackspacecloud.com/1025100/servers/0c3c0349-3c7b-4c3b-8c8a-3706e9b8257c", "rel": "bookmark"}], "key_name": "steve", "image": {"id": "59ab613b-8040-4a06-a5de-61a8a337b2c6", "links": [{"href": "https://dfw.servers.api.rackspacecloud.com/1025100/images/59ab613b-8040-4a06-a5de-61a8a337b2c6", "rel": "bookmark"}]}, "RAX-PUBLIC-IP-ZONE-ID:publicIPZoneId": "118df98ffba182a9ca16b796c24dc45e95d60122645d82eb0d9c387f", "OS-EXT-STS:task_state": "scheduling", "OS-EXT-STS:vm_state": "building", "flavor": {"id": "2", "links": [{"href": "https://dfw.servers.api.rackspacecloud.com/1025100/flavors/2", "rel": "bookmark"}]}, "id": "0c3c0349-3c7b-4c3b-8c8a-3706e9b8257c", "user_id": "a1f874751044405396a148b2787b8fc3", "name": "zs-itguys-dev.gotdns.com", "created": "2017-12-07T22:23:57Z", "tenant_id": "1025100", "OS-DCF:diskConfig": "MANUAL", "accessIPv4": "", "accessIPv6": "", "progress": 0, "OS-EXT-STS:power_state": 0, "config_drive": "", "metadata": {}}}

Error message:

Syntax error at line 1: {"server": {"status": "BUILD", "updated": "2017-12-07T22:23:57Z", "hostId": "", "addresses": {>>>}<<<, "links": [{"href": "https://dfw.servers.api.rackspacecloud.com/v2/1025100/servers/0c3c0349-3c7b-4c3b-8c8a-3706e9b8257c", "rel": "self"}, {"href": "https://dfw.servers.api.rackspacecloud.com/1025100/servers/0c3c0349-3c7b-4c3b-8c8a-3706e9b8257c", "rel": "bookmark"}], "key_name": "steve", "image": {"id": "59ab613b-8040-4a06-a5de-61a8a337b2c6", "links": [{"href": "https://dfw.servers.api.rackspacecloud.com/1025100/images/59ab613b-8040-4a06-a5de-61a8a337b2c6", "rel": "bookmark"}]}, "RAX-PUBLIC-IP-ZONE-ID:publicIPZoneId": "118df98ffba182a9ca16b796c24dc45e95d60122645d82eb0d9c387f", "OS-EXT-STS:task_state": "scheduling", "OS-EXT-STS:vm_state": "building", "flavor": {"id": "2", "links": [{"href": "https://dfw.servers.api.rackspacecloud.com/1025100/flavors/2", "rel": "bookmark"}]}, "id": "0c3c0349-3c7b-4c3b-8c8a-3706e9b8257c", "user_id": "a1f874751044405396a148b2787b8fc3", "name": "zs-itguys-dev.gotdns.com", "created": "2017-12-07T22:23:57Z", "tenant_id": "1025100", "OS-DCF:diskConfig": "MANUAL", "accessIPv4": "", "accessIPv6": "", "progress": 0, "OS-EXT-STS:power_state": 0, "config_drive": "", "metadata": {}}} syntax error, unexpected '}', expecting string literal

pgibbs-openmake commented 6 years ago

Looks like the parser is throwing an error for an empty array {} since it is expecting a string. In DMScript this:

set arr={"hello": {"a":"b"}};

is valid, whereas:

set arr={"hello": {}};

is not. I'll need to dig into the parser grammar and see what I can sort out.