This is an automated email from the ASF dual-hosted git repository.
bdelacretaz pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/sling-whiteboard.git
The following commit(s) were added to refs/heads/master by this push:
new f1e1674 Generate and serve OpenAPI document
f1e1674 is described below
commit f1e16744a339aa1e31936339046a6abeb866f00a
Author: Bertrand Delacretaz <[email protected]>
AuthorDate: Wed Sep 15 11:10:37 2021 +0200
Generate and serve OpenAPI document
---
aries-jax-rs-whiteboard/README.md | 8 ++++++--
aries-jax-rs-whiteboard/bnd.bnd | 4 +---
aries-jax-rs-whiteboard/pom.xml | 21 +++++++++++++++++++++
3 files changed, 28 insertions(+), 5 deletions(-)
diff --git a/aries-jax-rs-whiteboard/README.md
b/aries-jax-rs-whiteboard/README.md
index 38a0bdf..c08b61b 100644
--- a/aries-jax-rs-whiteboard/README.md
+++ b/aries-jax-rs-whiteboard/README.md
@@ -15,8 +15,12 @@ Then open http://localhost:8080 - which might require
logging in
at http://localhost:8080/system/console first.
http://localhost:8080/api/jaxrs/test/testing.this (for example) should
-then address the JAX-RS
[`TestService`](./src/main/java/org/apache/sling/jaxrs/TestService.java)
resource, while
-http://localhost:8080/api/sling.json is served by Sling as usual.
+then address the JAX-RS
[`TestService`](./src/main/java/org/apache/sling/jaxrs/TestService.java)
resource.
+
+The corresponding OpenAPI JSON document is available at
http://localhost:8080/api/openapi/openapi.json
+
+All other URLs outside of `/api/jaxrs` and `/api/openapi`, like
http://localhost:8080/api/sling.json
+are served by Sling as usual.
A POST can increment the test counter, such as:
diff --git a/aries-jax-rs-whiteboard/bnd.bnd b/aries-jax-rs-whiteboard/bnd.bnd
index fe68662..31c9080 100644
--- a/aries-jax-rs-whiteboard/bnd.bnd
+++ b/aries-jax-rs-whiteboard/bnd.bnd
@@ -1,3 +1 @@
-Sling-Initial-Content: SLING-INF/initial-content
-Sling-Nodetypes: SLING-INF/nodetypes/test-content-nodetypes.cnd
-Sling-Bundle-Resources:
/libs/sling/servlet/default/N.GQLschema.jsp;path:=/schemas/default/N.GQLschema.jsp
\ No newline at end of file
+Sling-Bundle-Resources:
/api/openapi/openapi.json;path:=/META-INF/resources/openapi.json
\ No newline at end of file
diff --git a/aries-jax-rs-whiteboard/pom.xml b/aries-jax-rs-whiteboard/pom.xml
index 36993fc..281d4fe 100644
--- a/aries-jax-rs-whiteboard/pom.xml
+++ b/aries-jax-rs-whiteboard/pom.xml
@@ -32,6 +32,7 @@
<version>0.0.1-SNAPSHOT</version>
<name>Apache Sling Aries JAX-RS Whiteboard Experiments</name>
+ <description>Minimal Sling application using OSGi components as JAX-RS
resources</description>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
@@ -94,6 +95,26 @@
<failOnMissing>false</failOnMissing>
</configuration>
</plugin>
+ <plugin>
+ <!-- docs at http://geronimo.apache.org/microprofile/openapi.html -->
+ <groupId>org.apache.geronimo</groupId>
+ <artifactId>geronimo-openapi-maven-plugin</artifactId>
+ <version>1.0.14</version>
+ <executions>
+ <execution>
+ <id>generate-openapi.json</id>
+ <goals>
+ <goal>openapi.json</goal>
+ </goals>
+ <configuration>
+
<application>org.apache.aries.jax.rs.whiteboard.internal.DefaultApplication</application>
+ <endpointClasses>
+
<endpointClass>org.apache.sling.jaxrs.TestService</endpointClass>
+ </endpointClasses>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
</plugins>
</build>