Page MenuHomePhabricator

Omit fields instead of making the value null
Open, Needs TriagePublic

Description

Mediawiki REST API responses may provide null values.

  • BETTER: It would be better to mark the value as undefined instead of null. Then TypeScript clients don't need to do something like this.
  • BEST: It would be best to omit those fields. This would also save some network bandwidth and parsing overhead on the client.

Is this something that could be changed? Are there reasons for using null?
I do appreciate the consistency of the API and would like to see that continued. So, if this behavior can be changed it should be changed for all endpoints.