Preamble
I just find out that actually there is no way to put a message above an article that has a JSON content model (example JSON page).
Actual situation
They already exist some ways to put content above a page, like:
- the very useful MediaWiki:Scribunto-doc-page-name that allow the transclusion of the Lua module documentation from a subpage (example · reference)
- the MediaWiki:Clearyourcache system message that is shown only for JavaScript and CSS pages. more specifically a system config page or and user config page (example · T191800)
Having said that, it seems that no system message is displayed above a JSON page and as far as I know it does not exist an MediaWiki:Article-nonwiki-header-page-name or whatever.
Proposal
Like the behaviour of every Scribunto module, for articles with the JSON content model we could automatically try to display a subpage and transclude it on the top.
So we can create a new system message called MediaWiki:Article-nonwiki-header-page-name or whatsoever to keep the value of that subpage like $1/header.
I don't think that anyone has never created a /doc or /header subpage under a JSON page so I think it will not create any strange impact. Anyway, thanks to the system message, it could be personalized per-wiki to overcome every need.