Skip to content
This repository has been archived by the owner on Aug 22, 2019. It is now read-only.

Issuer API parser error: "SyntaxError: Unexpected token D ..." #1005

Closed
nfreear opened this issue Feb 24, 2014 · 2 comments
Closed

Issuer API parser error: "SyntaxError: Unexpected token D ..." #1005

nfreear opened this issue Feb 24, 2014 · 2 comments

Comments

@nfreear
Copy link

nfreear commented Feb 24, 2014

Hi,

I'm not sure if this is a bug on our side or in the Issuer API...

When we try to add badges from a site I maintain called Cloudworks to Mozilla Backpack we're seeing errors.

This seems to be the relevant part of the error:

"message":"Unexpected token D","stack":"SyntaxError: Unexpected token D\n at Object.parse (native)\n at Request._callback (/var/www/openbadges/node_modules/openbadges-validator/lib/resources.js:111:21

The assertion validates:

I've experimented with shortening the description for the Badge-Class, to 128 then to 64 characters.

Can anyone spot the problem please?

Many thanks,

Nick

@kayaelle
Copy link

Hi Nick,

Try getting rid of the backslashes in the url values.

Kerri

On Feb 24, 2014, at 4:37 AM, Nick Freear notifications@github.com wrote:

Hi,

I'm not sure if this is a bug on our side or in the Issuer API...

When we try to add badges from a site I maintain called Cloudworks to Mozilla Backpack we're seeing errors.

This seems to be the relevant part of the error:

"message":"Unexpected token D","stack":"SyntaxError: Unexpected token D\n at Object.parse (native)\n at Request.callback (/var/www/openbadges/nodemodules/openbadges-validator/lib/resources.js:111:21

HTML page, http://cloudworks.ac.uk/badge/issue/364
Assertion, http://cloudworks.ac.uk/badge/assertion/364
https://backpack.openbadges.org/issuer/assertion?assertion=http%3A%2F%2Fcloudworks.ac.uk%2Fbadge%2Fassertion%2F364
Badge, http://cloudworks.ac.uk/badge/badge_class/8.json
Organization, http://cloudworks.ac.uk/badge/organization.json
The assertion validates:

http://validator.openbadges.org/?assertion=http://cloudworks.ac.uk/badge/assertion/364
I've experimented with shortening the description for the Badge-Class, to 128 then to 64 characters.

Can anyone spot the problem please?

Many thanks,

Nick


Reply to this email directly or view it on GitHub.

@nfreear
Copy link
Author

nfreear commented Feb 24, 2014

Hi kayaelle,

Thanks for the swift response!

Yes, I see why this might be a problem. The "/" is valid JSON I think, but JSON Lint replaces them with "/" in the pretty-printed output. And there is now a constant in PHP,

FYI, I've fixed here,

Thanks again, Nick.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants