From b52d97475a1e8f8d55e8377549b4837f6b59d77f Mon Sep 17 00:00:00 2001 From: DAHAG-ArisNourbakhsh <104843708+DAHAG-ArisNourbakhsh@users.noreply.github.com> Date: Thu, 21 Dec 2023 12:07:33 +0100 Subject: [PATCH] Add raw OpenApi documentation files to rest-api documentation (#22940) Add raw OpenApi documentation files to rest-api documentation Closes #21559 Signed-off-by: Aris Nourbakhsh Signed-off-by: Alexander Schwartz Co-authored-by: Alexander Schwartz --- services/pom.xml | 62 +++++++++++++++++++ .../keycloak-admin-api/index.mustache | 14 +++++ 2 files changed, 76 insertions(+) diff --git a/services/pom.xml b/services/pom.xml index 9a58c98c1e..3e56fca2a8 100755 --- a/services/pom.xml +++ b/services/pom.xml @@ -330,6 +330,67 @@ left ${project.basedir}/target/apidocs-rest/asciidoc + + true + false + + + + + + + maven-resources-plugin + + + copy-raw-openapi-definition + package + + copy-resources + + + ${project.basedir}/target/apidocs-rest/output + + + ${project.build.directory}/apidocs-rest/swagger/apidocs + + **/openapi.yaml + **/openapi.json + + + + true + + + + + + + + + + + product + + + product + + + + + + org.asciidoctor + asciidoctor-maven-plugin + + + generate-docs + package + + process-asciidoc + + + + false + true @@ -338,5 +399,6 @@ + diff --git a/services/src/docs/openapi-generator-templates/keycloak-admin-api/index.mustache b/services/src/docs/openapi-generator-templates/keycloak-admin-api/index.mustache index 7356c82bd0..1ad5d8a25e 100644 --- a/services/src/docs/openapi-generator-templates/keycloak-admin-api/index.mustache +++ b/services/src/docs/openapi-generator-templates/keycloak-admin-api/index.mustache @@ -1,6 +1,7 @@ = {{{appName}}} {{#headerAttributes}} :toc: left +:icons: font :toclevels: 2 :keywords: openapi, rest, {{appName}} :specDir: {{specDir}} @@ -30,6 +31,19 @@ Version: {{version}} For example `http://localhost:8080/admin/realms` +ifdef::project_community[] + +=== OpenAPI Definitions + +WARNING: The OpenAPI definitions are a feature that is currently in preview. +Please provide your feedback by link:https://github.com/keycloak/keycloak/discussions/8898[joining this discussion] while we’re continuing to work on this. +If you find something is outdated or wrong, create a GitHub issue and provide a pull request. + +* link:openapi.json[OpenAPI definition in JSON format] +* link:openapi.yaml[OpenAPI definition in YAML format] + +endif::[] + {{#specinclude}}intro.adoc{{/specinclude}} {{#hasAuthMethods}}