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

json parser failing on valid json #232

Open
sbtaylor15 opened this issue Dec 7, 2017 · 1 comment
Open

json parser failing on valid json #232

sbtaylor15 opened this issue Dec 7, 2017 · 1 comment

Comments

@sbtaylor15
Copy link
Contributor

{"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
Copy link
Contributor

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.

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

No branches or pull requests

2 participants