-
Notifications
You must be signed in to change notification settings - Fork 146
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
Fixed typing error #511
base: main
Are you sure you want to change the base?
Fixed typing error #511
Conversation
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.
@jaxoncreed
Not sure this change is correct.
You cannot parse json or jsonld if data is not a valid json. A minimal string is "{}".
@jeff-zucker do you have any idea ?
At least as far as the typings are concerned, |
@bourgeoa. I looked into it a bit more. |
So it is a question of whether we should let the user create an invalid JSON-LD file. If we say || undefined, we are saying - go ahead create an empty JSON-LD file, you'lll be sorry later, but you asked for it. I we say || {} we are creating something that a later GET with accept=json-ld will not fail on. |
I guess my tendency would be to go ahead and supply the {}. |
The intent of the user's request is "create an empty JSON-LD resource". And BTW I mean jsonString || "{}"; - that will create an empty JSON-LD resource. |
Other Test and Linter Fixes: