-
Notifications
You must be signed in to change notification settings - Fork 0
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
Structured data updates #1
base: structured_data_pkg
Are you sure you want to change the base?
Conversation
obj = JSON.parse(JSON.stringify(obj)); | ||
|
||
setValueAtJsonLdPath(obj, path, searchKey); | ||
const jsonLines = JSON.stringify(obj, null, 2).split('\n'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The line number we report doesn't apply to the JSON that's passed in, but rather to the stringified JSON. That's not an issue for the feature, but I'm it seems weird when using the sd-validation library as an API consumer.
Should we return the applicable JSON from the validate function?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree it's weird from the library perspective, but I think we can punt and just file an issue/TODO/jsdoc comment to mark this explicitly.
obj = JSON.parse(JSON.stringify(obj)); | ||
|
||
setValueAtJsonLdPath(obj, path, searchKey); | ||
const jsonLines = JSON.stringify(obj, null, 2).split('\n'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree it's weird from the library perspective, but I think we can punt and just file an issue/TODO/jsdoc comment to mark this explicitly.
@@ -21,6 +21,7 @@ describe('JSON-LD validation', () => { | |||
assert.equal(errors.length, 1); | |||
assert.equal(errors[0].message, 'Unknown keyword'); | |||
assert.equal(errors[0].path, '@test'); | |||
assert.equal(errors[0].line, 4); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
No description provided.