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 <aris.nourbakhsh@dahag.de>
Signed-off-by: Alexander Schwartz <aschwart@redhat.com>
Co-authored-by: Alexander Schwartz <aschwart@redhat.com>
This commit is contained in:
DAHAG-ArisNourbakhsh 2023-12-21 12:07:33 +01:00 committed by GitHub
parent 8d887febb9
commit b52d97475a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 76 additions and 0 deletions

View file

@ -330,6 +330,67 @@
<toc/>
<toc-position>left</toc-position>
<generated>${project.basedir}/target/apidocs-rest/asciidoc</generated>
<!-- Boolean attributes are passed as defined/undefined to AsciiDoc, not at their literal value -->
<project_community>true</project_community>
<project_product>false</project_product>
</attributes>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-resources-plugin</artifactId>
<executions>
<execution>
<id>copy-raw-openapi-definition</id>
<phase>package</phase>
<goals>
<goal>copy-resources</goal>
</goals>
<configuration>
<outputDirectory>${project.basedir}/target/apidocs-rest/output</outputDirectory>
<resources>
<resource>
<directory>${project.build.directory}/apidocs-rest/swagger/apidocs</directory>
<includes>
<include>**/openapi.yaml</include>
<include>**/openapi.json</include>
</includes>
</resource>
</resources>
<overwrite>true</overwrite>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
<profile>
<id>product</id>
<activation>
<property>
<name>product</name>
</property>
</activation>
<build>
<plugins>
<plugin>
<groupId>org.asciidoctor</groupId>
<artifactId>asciidoctor-maven-plugin</artifactId>
<executions>
<execution>
<id>generate-docs</id>
<phase>package</phase>
<goals>
<goal>process-asciidoc</goal>
</goals>
<configuration combine.children="append">
<attributes combine.children="append">
<project_community>false</project_community>
<project_product>true</project_product>
</attributes>
</configuration>
</execution>
@ -338,5 +399,6 @@
</plugins>
</build>
</profile>
</profiles>
</project>

View file

@ -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 were 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}}