JSONFeed icon indicating copy to clipboard operation
JSONFeed copied to clipboard

Empty properties

Open sonicdoe opened this issue 8 years ago • 2 comments

Currently, https://micro.blog/feeds/manton.json includes the following item:

{
  "author": {
    "_microblog": {
      "username": "SciPhi"
    },
    "avatar": "http://www.gravatar.com/avatar/e59f6b41f418b9e6d37aad95db19ea7c?s=96",
    "name": "Phi.Sanders",
    "url": ""
  },
  "content_html": "<p>🔗 Mike Monteiro #μβ — <a href=\"https://twitter.com/monteiro/status/865270045806444544\">twitter.com/monteiro/…</a> </p>",
  "date_published": "2017-05-18T19:09:00+00:00",
  "id": "83721",
  "url": "http://SciPhi.micro.blog/2017/05/18/mike-monteiro-httpstwittercommonteirostatus.html"
}

As you can see, author.url is present but empty (and therefore not a valid URL). Is this considered valid according to the spec?

sonicdoe avatar May 18 '17 22:05 sonicdoe

If its not considered valid I'd argue it should be considered value.

The alternative is not to have author.url which would mean I'd always have to check to see if it exists before I could use it. Would love to avoid things like that

donohoe avatar May 19 '17 01:05 donohoe

I’d argue the opposite of what @donohoe is suggesting. Here’s why:

Specifying that author.url should be a valid URL (if it is present) would allow you to use it directly. If it is empty, you probably wouldn’t want to use it anyway; what good is <a href="">Jane Doe</a>?

Furthermore, the spec is already pretty clear about it being an optional property, therefore, you would have to check for presence anyway.

sonicdoe avatar May 20 '17 09:05 sonicdoe