The language code of the page content language and the direction of the language is needed to generate the HTML attributes lang and dir. The lang must be BCP 47 conform. The mapping from the internal language code to the BCP 47 conform language code and the mapping from the language code to the direction of the language exists only in PHP, so they have to delivered with the response.
I see two possibilities:
"extract": "<p>Eine <b>Strasse</b> (von lat. [via] <i>strata</i> «gepflasterter Weg») ist ein …</p>", "lang": "de-CH", "dir": "ltr",
or
"extract": "<div class=\"mw-content-ltr\" dir=\"ltr\" lang=\"de-CH\"><p>Eine <b>Strasse</b> (von lat. [via] <i>strata</i> «gepflasterter Weg») ist ein …</p></div>",
I prefer the second option but this is an incompatible change.