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

Structured data updates #1

Open
wants to merge 3 commits into
base: structured_data_pkg
Choose a base branch
from

Conversation

mattzeunert
Copy link
Owner

No description provided.

obj = JSON.parse(JSON.stringify(obj));

setValueAtJsonLdPath(obj, path, searchKey);
const jsonLines = JSON.stringify(obj, null, 2).split('\n');
Copy link
Owner Author

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?

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');

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);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

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.

2 participants