Admin REST API docs: a page per operation, searchable, from the openapi.json the build already publishes · keycloak keycloak · Discussion #55339 · GitHub
You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Admin REST API docs: a page per operation, searchable, from the openapi.json the build already publishes
#55339
A page for each of the 415 operations and each of the 119 models, so a reader who needs one endpoint opens it directly, and search across the API.
Every anchor the page has today lands where it did: each resource, each operation, the numbered parts under each (_parameters_7 and the rest), and each model.
The 22 resources sit under three headings, clients and scopes, users and roles, and the realm's configuration, as the admin console arranges them.
Every page is also published as Markdown with an llms.txt, so assistants helping people administer Keycloak read the API itself.
On the same machine, opening the operation that lists a realm's users downloads 50 KB in 6 requests instead of 265 KB in 8, lays out 2,700 elements instead of 124,000, and shows its content in 0.24 s instead of 0.98 s.
One thing I found along the way: the 31 Authorization Services operations under /authz/resource-server carry no tag or summary in the OpenAPI document, so today's page files them under "default". The rebuild names that section as the console does, client authorization, and keeps its anchor. Tagging them in the source would fix it for every consumer of openapi.json.
The question is whether you'd take this into the release docs build. It would replace the openapi-generator asciidoc step in services with a sourcey build over the same openapi.json, writing a static folder to the same docs-api//rest-api/ path. If that's of interest, I'll open the issue and the PR in whatever shape suits the build.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
I maintain sourcey, an open-source docs engine, and I rebuilt the Admin REST API page (docs-api//rest-api/) from the openapi.json published beside it, at its own address: https://sourcey-keycloak.pages.dev/docs-api/latest/rest-api/
What it does:
_parameters_7and the rest), and each model.On the same machine, opening the operation that lists a realm's users downloads 50 KB in 6 requests instead of 265 KB in 8, lays out 2,700 elements instead of 124,000, and shows its content in 0.24 s instead of 0.98 s.
One thing I found along the way: the 31 Authorization Services operations under
/authz/resource-servercarry no tag or summary in the OpenAPI document, so today's page files them under "default". The rebuild names that section as the console does, client authorization, and keeps its anchor. Tagging them in the source would fix it for every consumer of openapi.json.The question is whether you'd take this into the release docs build. It would replace the openapi-generator asciidoc step in
serviceswith a sourcey build over the same openapi.json, writing a static folder to the same docs-api//rest-api/ path. If that's of interest, I'll open the issue and the PR in whatever shape suits the build.Kam / maintainer, sourcey
All reactions