The "Example" extension (https://www.mediawiki.org/wiki/Extension:Example) provides various examples of how to implement common features.
We also have an example Core REST API extension, which we used in writing documentation. It was created under T232508: Create REST API example extension. It currently lives under an individual developer's github at https://github.com/bpirkle/RestApiExample
Per comment on T232508: Create REST API example extension by @Aklapper , it would be a good idea to add the Core REST API example to the Example extension.
As part of this, we should review the REST API example code against the current REST API conventions, as they have changed since the REST API example extension was created. Specifically, the current example does not conform to T232485: RFC: Core REST API namespace and version.
Once this is done, it should be mentioned on T225761: Document the REST API on mediawiki.org
Also, be aware of T156568: Review and update the Examples extension. In addition to giving some context, that page helps explain why the extension is documented at "Extension:Example" (singular) but its name in extension.json is "examples" (plural).