How do you represent infinity in a JSON API?
问题 What is the best way to represent infinity in a JSON API? e.g. free to read articles for this month (this will be a finite number on some subscriptions and infinite on the premium subscription). Is it a better idea to return null for this use case or to extend JSON and use the javascript's Infinity value? The latter seems more appropriate, but I've never seen an example of an API which does this. It would also be cool if anyone had any examples of public Web APIs which represent infinity. 回答1