Serialize NAV objects as JSON

Today in a forum someone asks this question: can I serialize a Microsoft Dynamics NAV object (record in a table) as JSON in C/AL? The new AL language (Extensions 2.0) has native support for JSON (for example JsonObjectClass) but in C/AL there’s no a native way…