Conversation
There was a problem hiding this comment.
@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: