]> source.dussan.org Git - archiva.git/commitdiff
Moving from enunciate to OpenAPI documentation
authorMartin Stockhammer <martin_s@apache.org>
Mon, 22 Jun 2020 18:08:22 +0000 (20:08 +0200)
committerMartin Stockhammer <martin_s@apache.org>
Mon, 22 Jun 2020 18:08:22 +0000 (20:08 +0200)
31 files changed:
archiva-modules/archiva-web/archiva-rest/archiva-rest-api/pom.xml
archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/enunciate/enunciate.xml [deleted file]
archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/enunciate/enunciate.xml.org [new file with mode: 0644]
archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/java/org/apache/archiva/rest/api/services/ArchivaAdministrationService.java
archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/java/org/apache/archiva/rest/api/services/ArchivaRuntimeConfigurationService.java
archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/java/org/apache/archiva/rest/api/services/BrowseService.java
archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/java/org/apache/archiva/rest/api/services/CommonServices.java
archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/java/org/apache/archiva/rest/api/services/ManagedRepositoriesService.java
archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/java/org/apache/archiva/rest/api/services/MergeRepositoriesService.java
archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/java/org/apache/archiva/rest/api/services/NetworkProxyService.java
archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/java/org/apache/archiva/rest/api/services/PingService.java
archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/java/org/apache/archiva/rest/api/services/PluginsService.java
archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/java/org/apache/archiva/rest/api/services/ProxyConnectorRuleService.java
archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/java/org/apache/archiva/rest/api/services/ProxyConnectorService.java
archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/java/org/apache/archiva/rest/api/services/RedbackRuntimeConfigurationService.java
archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/java/org/apache/archiva/rest/api/services/RemoteRepositoriesService.java
archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/java/org/apache/archiva/rest/api/services/ReportRepositoriesService.java
archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/java/org/apache/archiva/rest/api/services/RepositoriesService.java
archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/java/org/apache/archiva/rest/api/services/RepositoryGroupService.java
archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/java/org/apache/archiva/rest/api/services/SearchService.java
archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/java/org/apache/archiva/rest/api/services/SystemStatusService.java
archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/resources/openapi-codegen-ignore [new file with mode: 0644]
archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/resources/openapi-configuration.yaml [new file with mode: 0644]
archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/resources/templates/bodyParam.mustache [new file with mode: 0644]
archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/resources/templates/formParam.mustache [new file with mode: 0644]
archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/resources/templates/headerParam.mustache [new file with mode: 0644]
archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/resources/templates/index.mustache [new file with mode: 0644]
archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/resources/templates/pathParam.mustache [new file with mode: 0644]
archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/resources/templates/queryParam.mustache [new file with mode: 0644]
archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/resources/templates/style.css.mustache [new file with mode: 0644]
status-dep.txt

index e50ff83e7d6acc43e593ce5c788e628a1d86f462..9a64d1d507f60bb890a4ddd169dd71a7b0979224 100644 (file)
   <properties>
     <enunciate.docsDir>${project.build.outputDirectory}/rest-docs-archiva-rest-api</enunciate.docsDir>
     <site.staging.base>${project.parent.parent.parent.basedir}</site.staging.base>
+    <swagger-maven-plugin-version>2.1.2</swagger-maven-plugin-version>
+    <io.swagger.version>2.1.2</io.swagger.version>
   </properties>
 
   <dependencies>
     <dependency>
       <groupId>org.apache.archiva</groupId>
       <artifactId>archiva-security-common</artifactId>
-
     </dependency>
-
     <dependency>
       <groupId>org.apache.archiva</groupId>
       <artifactId>archiva-repository-admin-api</artifactId>
     </dependency>
-
     <dependency>
       <groupId>org.apache.archiva</groupId>
       <artifactId>archiva-policies</artifactId>
     </dependency>
-
     <dependency>
       <groupId>org.apache.archiva</groupId>
       <artifactId>metadata-model</artifactId>
     </dependency>
-
     <dependency>
       <groupId>org.apache.archiva.maven</groupId>
       <artifactId>archiva-maven-model</artifactId>
     </dependency>
-
     <dependency>
       <groupId>org.apache.archiva</groupId>
       <artifactId>archiva-repository-scanner</artifactId>
     </dependency>
-
     <dependency>
       <groupId>org.apache.archiva</groupId>
       <artifactId>repository-statistics</artifactId>
     </dependency>
-
     <dependency>
       <groupId>org.apache.archiva</groupId>
       <artifactId>metadata-statistics-api</artifactId>
     </dependency>
-
     <dependency>
       <groupId>org.apache.archiva.redback</groupId>
       <artifactId>redback-authorization-api</artifactId>
       <groupId>javax.ws.rs</groupId>
       <artifactId>javax.ws.rs-api</artifactId>
     </dependency>
+    <dependency>
+      <groupId>io.swagger.core.v3</groupId>
+      <artifactId>swagger-core</artifactId>
+      <scope>compile</scope>
+      <version>${io.swagger.version}</version>
+      <exclusions>
+        <exclusion>
+          <groupId>javax.ws.rs</groupId>
+          <artifactId>jsr311-api</artifactId>
+        </exclusion>
+      </exclusions>
+    </dependency>
+    <dependency>
+      <groupId>io.swagger.core.v3</groupId>
+      <artifactId>swagger-jaxrs2</artifactId>
+      <version>${io.swagger.version}</version>
+      <exclusions>
+        <exclusion>
+          <groupId>javax.ws.rs</groupId>
+          <artifactId>jsr311-api</artifactId>
+        </exclusion>
+      </exclusions>
+    </dependency>
+    <dependency>
+      <groupId>io.swagger.core.v3</groupId>
+      <artifactId>swagger-annotations</artifactId>
+      <version>${io.swagger.version}</version>
+      <exclusions>
+        <exclusion>
+          <groupId>javax.ws.rs</groupId>
+          <artifactId>jsr311-api</artifactId>
+        </exclusion>
+      </exclusions>
+    </dependency>
+
+
     <!-- normally not needed but here for wadl feature currently in cxf -->
     <dependency>
       <groupId>org.apache.cxf</groupId>
 
   <build>
     <plugins>
+      <plugin>
+        <groupId>org.apache.rat</groupId>
+        <artifactId>apache-rat-plugin</artifactId>
+        <configuration>
+          <excludes>
+            <exclude>target/generated</exclude>
+            <exclude>src/main/resources/templates/*</exclude>
+            <exclude>src/main/resources/openapi-codegen-ignore</exclude>
+          </excludes>
+        </configuration>
+      </plugin>
       <plugin>
         <groupId>org.apache.maven.plugins</groupId>
         <artifactId>maven-source-plugin</artifactId>
           </execution>
         </executions>
       </plugin>
+      <plugin>
+        <groupId>io.swagger.core.v3</groupId>
+        <artifactId>swagger-maven-plugin</artifactId>
+        <version>${swagger-maven-plugin-version}</version>
+        <configuration>
+          <outputFileName>openapi</outputFileName>
+          <outputPath>${project.build.directory}/generated</outputPath>
+          <outputFormat>JSONANDYAML</outputFormat>
+          <resourcePackages>
+            <package>org.apache.archiva.rest.api</package>
+          </resourcePackages>
+          <prettyPrint>TRUE</prettyPrint>
+          <configurationFilePath>${project.basedir}/src/main/resources/openapi-configuration.yaml</configurationFilePath>
+        </configuration>
+        <executions>
+          <execution>
+            <phase>compile</phase>
+            <goals>
+              <goal>resolve</goal>
+            </goals>
+          </execution>
+        </executions>
+      </plugin>
+
+      <plugin>
+        <groupId>io.swagger.codegen.v3</groupId>
+        <artifactId>swagger-codegen-maven-plugin</artifactId>
+        <version>3.0.20</version>
+        <executions>
+          <execution>
+            <phase>compile</phase>
+            <goals>
+              <goal>generate</goal>
+            </goals>
+            <configuration>
+              <inputSpec>${project.build.directory}/generated/openapi.yaml</inputSpec>
+              <language>html</language>
+              <output>${project.build.directory}/generated-sources</output>
+              <ignoreFileOverride>${project.basedir}/src/main/resources/openapi-codegen-ignore</ignoreFileOverride>
+              <templateDirectory>${project.basedir}/src/main/resources/templates</templateDirectory>
+              <supportingFilesToGenerate>index.html,index2.html</supportingFilesToGenerate>
+            </configuration>
+          </execution>
+        </executions>
+      </plugin>
 
+      <plugin>
+        <artifactId>maven-resources-plugin</artifactId>
+        <version>3.1.0</version>
+        <executions>
+          <execution>
+            <id>copy-resources</id>
+            <phase>site</phase>
+            <goals>
+              <goal>copy-resources</goal>
+            </goals>
+            <configuration>
+              <outputDirectory>${basedir}/target/site/openapi/</outputDirectory>
+              <resources>
+                <resource>
+                  <directory>${project.build.directory}/generated</directory>         <!-- source directory -->
+                  <filtering>false</filtering>
+                  <include>openapi.json</include>
+                  <include>openapi.yaml</include>
+                </resource>
+                <resource>
+                  <directory>${project.build.directory}/generated-sources/</directory>
+                  <filtering>false</filtering>
+                  <include>**/*</include>
+                  <exclude>.swagger-codegen/**</exclude>
+                  <exclude>.swagger-codegen-ignore</exclude>
+                </resource>
+              </resources>
+            </configuration>
+          </execution>
+        </executions>
+      </plugin>
     </plugins>
   </build>
 
diff --git a/archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/enunciate/enunciate.xml b/archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/enunciate/enunciate.xml
deleted file mode 100644 (file)
index c0f27aa..0000000
+++ /dev/null
@@ -1,45 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-  ~ Licensed to the Apache Software Foundation (ASF) under one
-  ~ or more contributor license agreements.  See the NOTICE file
-  ~ distributed with this work for additional information
-  ~ regarding copyright ownership.  The ASF licenses this file
-  ~ to you under the Apache License, Version 2.0 (the
-  ~ "License"); you may not use this file except in compliance
-  ~ with the License.  You may obtain a copy of the License at
-  ~
-  ~   http://www.apache.org/licenses/LICENSE-2.0
-  ~
-  ~ Unless required by applicable law or agreed to in writing,
-  ~ software distributed under the License is distributed on an
-  ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-  ~ KIND, either express or implied.  See the License for the
-  ~ specific language governing permissions and limitations
-  ~ under the License.
-  -->
-<enunciate xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-   xsi:noNamespaceSchemaLocation="https://raw.githubusercontent.com/stoicflame/enunciate/v2.12.0/top/src/main/resources/META-INF/enunciate-2.2.0.xsd" >
-
-  <title>Apache Archiva REST API</title>
-  <modules>
-
-    <cxf disabled="false"/>
-    <jersey disabled="true" />
-    <c disabled="true"/>
-    <csharp disabled="true"/>
-    <obj-c disabled="true"/>
-    <jaxws-ri disabled="true"/>
-    <jaxws-support disabled="true"/>
-    <jaxrs>
-      <application path="restServices"/>
-    </jaxrs>
-
-    <docs disabled="false"
-          docsSubdir="" freemarkerTemplate="${project.basedir}/src/enunciate/archiva.fmt" css="${project.basedir}/src/enunciate/archiva.css" >
-      <!--<war docsDir="apidocs" />-->
-    </docs>
-
-
-  </modules>
-
-</enunciate>
\ No newline at end of file
diff --git a/archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/enunciate/enunciate.xml.org b/archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/enunciate/enunciate.xml.org
new file mode 100644 (file)
index 0000000..3e1fe06
--- /dev/null
@@ -0,0 +1,47 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  ~ Licensed to the Apache Software Foundation (ASF) under one
+  ~ or more contributor license agreements.  See the NOTICE file
+  ~ distributed with this work for additional information
+  ~ regarding copyright ownership.  The ASF licenses this file
+  ~ to you under the Apache License, Version 2.0 (the
+  ~ "License"); you may not use this file except in compliance
+  ~ with the License.  You may obtain a copy of the License at
+  ~
+  ~   http://www.apache.org/licenses/LICENSE-2.0
+  ~
+  ~ Unless required by applicable law or agreed to in writing,
+  ~ software distributed under the License is distributed on an
+  ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  ~ KIND, either express or implied.  See the License for the
+  ~ specific language governing permissions and limitations
+  ~ under the License.
+  -->
+<enunciate xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+   xsi:noNamespaceSchemaLocation="https://raw.githubusercontent.com/stoicflame/enunciate/v2.12.0/top/src/main/resources/META-INF/enunciate-2.2.0.xsd" >
+
+  <title>Apache Archiva REST API</title>
+  <modules>
+
+    <obj-c-xml-client disabled="true" />
+    <csharp-xml-client disabled="true" />
+    <cxf disabled="false"/>
+    <jersey disabled="true" />
+    <c disabled="true"/>
+    <csharp disabled="true"/>
+    <obj-c disabled="true"/>
+    <jaxws-ri disabled="true"/>
+    <jaxws-support disabled="true"/>
+    <jaxrs>
+      <application path="restServices"/>
+    </jaxrs>
+
+    <docs disabled="false"
+          docsSubdir="" freemarkerTemplate="${project.basedir}/src/enunciate/archiva.fmt" css="${project.basedir}/src/enunciate/archiva.css" >
+      <!--<war docsDir="apidocs" />-->
+    </docs>
+
+
+  </modules>
+
+</enunciate>
\ No newline at end of file
index 612ed0a96ecb1c78825a3966fad2d7ef9c8a9a46..77544cc8ee90150b35386c4e51835b60de72aa54 100644 (file)
@@ -18,6 +18,9 @@ package org.apache.archiva.rest.api.services;
  * under the License.
  */
 
+import io.swagger.v3.oas.annotations.Operation;
+import io.swagger.v3.oas.annotations.Parameter;
+import io.swagger.v3.oas.annotations.tags.Tag;
 import org.apache.archiva.admin.model.beans.FileType;
 import org.apache.archiva.admin.model.beans.LegacyArtifactPath;
 import org.apache.archiva.admin.model.beans.NetworkConfiguration;
@@ -42,32 +45,33 @@ import java.util.List;
  * @since 1.4-M1
  */
 @Path( "/archivaAdministrationService/" )
+@Tag( name = "Administration", description = "Admin Service" )
 public interface ArchivaAdministrationService
 {
     @Path( "getLegacyArtifactPaths" )
     @GET
-    @Produces( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML } )
+    @Produces( {MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML} )
     @RedbackAuthorization( permissions = ArchivaRoleConstants.OPERATION_MANAGE_CONFIGURATION )
-    List<LegacyArtifactPath> getLegacyArtifactPaths()
+    List<LegacyArtifactPath> getLegacyArtifactPaths( )
         throws ArchivaRestServiceException;
 
     @Path( "deleteLegacyArtifactPath" )
     @GET
-    @Produces( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_PLAIN } )
+    @Produces( {MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_PLAIN} )
     @RedbackAuthorization( permissions = ArchivaRoleConstants.OPERATION_MANAGE_CONFIGURATION )
     Boolean deleteLegacyArtifactPath( @QueryParam( "path" ) String path )
         throws ArchivaRestServiceException;
 
     @Path( "addFileTypePattern" )
     @GET
-    @Produces( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_PLAIN } )
+    @Produces( {MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_PLAIN} )
     @RedbackAuthorization( permissions = ArchivaRoleConstants.OPERATION_MANAGE_CONFIGURATION )
     Boolean addFileTypePattern( @QueryParam( "fileTypeId" ) String fileTypeId, @QueryParam( "pattern" ) String pattern )
         throws ArchivaRestServiceException;
 
     @Path( "removeFileTypePattern" )
     @GET
-    @Produces( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_PLAIN } )
+    @Produces( {MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_PLAIN} )
     @RedbackAuthorization( permissions = ArchivaRoleConstants.OPERATION_MANAGE_CONFIGURATION )
     Boolean removeFileTypePattern( @QueryParam( "fileTypeId" ) String fileTypeId,
                                    @QueryParam( "pattern" ) String pattern )
@@ -75,35 +79,43 @@ public interface ArchivaAdministrationService
 
     @Path( "getFileType" )
     @GET
-    @Produces( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML } )
+    @Produces( {MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML} )
     @RedbackAuthorization( permissions = ArchivaRoleConstants.OPERATION_MANAGE_CONFIGURATION )
-    FileType getFileType( @QueryParam( "fileTypeId" ) String fileTypeId )
+    @Operation(
+        summary = "Return the file type and its patterns",
+        description = "Returns a object that contains the file type and the configured patterns for this type"
+
+    )
+    FileType getFileType(
+        @Parameter( name = "fileTypeId", description = "The identifier of the file type",
+            allowEmptyValue = false, required = true )
+        @QueryParam( "fileTypeId" ) String fileTypeId )
         throws ArchivaRestServiceException;
 
     @Path( "addFileType" )
     @POST
-    @Consumes( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML } )
+    @Consumes( {MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML} )
     @RedbackAuthorization( permissions = ArchivaRoleConstants.OPERATION_MANAGE_CONFIGURATION )
     void addFileType( FileType fileType )
         throws ArchivaRestServiceException;
 
     @Path( "removeFileType" )
     @GET
-    @Produces( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_PLAIN } )
+    @Produces( {MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_PLAIN} )
     @RedbackAuthorization( permissions = ArchivaRoleConstants.OPERATION_MANAGE_CONFIGURATION )
     Boolean removeFileType( @QueryParam( "fileTypeId" ) String fileTypeId )
         throws ArchivaRestServiceException;
 
     @Path( "enabledKnownContentConsumer/{knownContentConsumer}" )
     @GET
-    @Produces( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_PLAIN } )
+    @Produces( {MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_PLAIN} )
     @RedbackAuthorization( permissions = ArchivaRoleConstants.OPERATION_MANAGE_CONFIGURATION )
     Boolean enabledKnownContentConsumer( @PathParam( "knownContentConsumer" ) String knownContentConsumer )
         throws ArchivaRestServiceException;
 
     @Path( "enabledKnownContentConsumers" )
     @POST
-    @Consumes( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML } )
+    @Consumes( {MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML} )
     @RedbackAuthorization( permissions = ArchivaRoleConstants.OPERATION_MANAGE_CONFIGURATION )
     void enabledKnownContentConsumers( List<String> knownContentConsumers )
         throws ArchivaRestServiceException;
@@ -111,44 +123,44 @@ public interface ArchivaAdministrationService
 
     @Path( "disabledKnownContentConsumer/{knownContentConsumer}" )
     @GET
-    @Produces( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_PLAIN } )
+    @Produces( {MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_PLAIN} )
     @RedbackAuthorization( permissions = ArchivaRoleConstants.OPERATION_MANAGE_CONFIGURATION )
     Boolean disabledKnownContentConsumer( @PathParam( "knownContentConsumer" ) String knownContentConsumer )
         throws ArchivaRestServiceException;
 
     @Path( "enabledInvalidContentConsumer/{invalidContentConsumer}" )
     @GET
-    @Produces( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_PLAIN } )
+    @Produces( {MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_PLAIN} )
     @RedbackAuthorization( permissions = ArchivaRoleConstants.OPERATION_MANAGE_CONFIGURATION )
     Boolean enabledInvalidContentConsumer( @PathParam( "invalidContentConsumer" ) String invalidContentConsumer )
         throws ArchivaRestServiceException;
 
     @Path( "enabledInvalidContentConsumers" )
     @POST
-    @Consumes( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML } )
+    @Consumes( {MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML} )
     @RedbackAuthorization( permissions = ArchivaRoleConstants.OPERATION_MANAGE_CONFIGURATION )
     void enabledInvalidContentConsumers( List<String> invalidContentConsumers )
         throws ArchivaRestServiceException;
 
     @Path( "disabledInvalidContentConsumer/{invalidContentConsumer}" )
     @GET
-    @Produces( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_PLAIN } )
+    @Produces( {MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_PLAIN} )
     @RedbackAuthorization( permissions = ArchivaRoleConstants.OPERATION_MANAGE_CONFIGURATION )
     Boolean disabledInvalidContentConsumer( @PathParam( "invalidContentConsumer" ) String invalidContentConsumer )
         throws ArchivaRestServiceException;
 
     @Path( "getFileTypes" )
     @GET
-    @Produces( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML } )
+    @Produces( {MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML} )
     @RedbackAuthorization( permissions = ArchivaRoleConstants.OPERATION_MANAGE_CONFIGURATION )
-    List<FileType> getFileTypes()
+    List<FileType> getFileTypes( )
         throws ArchivaRestServiceException;
 
     @Path( "getKnownContentConsumers" )
     @GET
-    @Produces( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML } )
+    @Produces( {MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML} )
     @RedbackAuthorization( permissions = ArchivaRoleConstants.OPERATION_MANAGE_CONFIGURATION )
-    List<String> getKnownContentConsumers()
+    List<String> getKnownContentConsumers( )
         throws ArchivaRestServiceException;
 
     /**
@@ -156,9 +168,9 @@ public interface ArchivaAdministrationService
      */
     @Path( "getKnownContentAdminRepositoryConsumers" )
     @GET
-    @Produces( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML } )
+    @Produces( {MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML} )
     @RedbackAuthorization( permissions = ArchivaRoleConstants.OPERATION_MANAGE_CONFIGURATION )
-    List<AdminRepositoryConsumer> getKnownContentAdminRepositoryConsumers()
+    List<AdminRepositoryConsumer> getKnownContentAdminRepositoryConsumers( )
         throws ArchivaRestServiceException;
 
     /**
@@ -166,49 +178,49 @@ public interface ArchivaAdministrationService
      */
     @Path( "getInvalidContentAdminRepositoryConsumers" )
     @GET
-    @Produces( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML } )
+    @Produces( {MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML} )
     @RedbackAuthorization( permissions = ArchivaRoleConstants.OPERATION_MANAGE_CONFIGURATION )
-    List<AdminRepositoryConsumer> getInvalidContentAdminRepositoryConsumers()
+    List<AdminRepositoryConsumer> getInvalidContentAdminRepositoryConsumers( )
         throws ArchivaRestServiceException;
 
     @Path( "getInvalidContentConsumers" )
     @GET
-    @Produces( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML } )
+    @Produces( {MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML} )
     @RedbackAuthorization( permissions = ArchivaRoleConstants.OPERATION_MANAGE_CONFIGURATION )
-    List<String> getInvalidContentConsumers()
+    List<String> getInvalidContentConsumers( )
         throws ArchivaRestServiceException;
 
     @Path( "getOrganisationInformation" )
     @GET
-    @Produces( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_PLAIN } )
+    @Produces( {MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_PLAIN} )
     @RedbackAuthorization( noPermission = true, noRestriction = true )
-    OrganisationInformation getOrganisationInformation()
+    OrganisationInformation getOrganisationInformation( )
         throws ArchivaRestServiceException;
 
     @Path( "setOrganisationInformation" )
     @POST
-    @Consumes( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML } )
+    @Consumes( {MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML} )
     @RedbackAuthorization( permissions = ArchivaRoleConstants.OPERATION_MANAGE_CONFIGURATION )
     void setOrganisationInformation( OrganisationInformation organisationInformation )
         throws ArchivaRestServiceException;
 
     @Path( "getUiConfiguration" )
     @GET
-    @Produces( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML } )
+    @Produces( {MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML} )
     @RedbackAuthorization( permissions = ArchivaRoleConstants.OPERATION_MANAGE_CONFIGURATION )
-    UiConfiguration getUiConfiguration()
+    UiConfiguration getUiConfiguration( )
         throws ArchivaRestServiceException;
 
     @Path( "registrationDisabled" )
     @GET
-    @Produces( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML } )
+    @Produces( {MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML} )
     @RedbackAuthorization( noRestriction = true, noPermission = true )
-    Boolean registrationDisabled()
+    Boolean registrationDisabled( )
         throws ArchivaRestServiceException;
 
     @Path( "setUiConfiguration" )
     @POST
-    @Consumes( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML } )
+    @Consumes( {MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML} )
     @RedbackAuthorization( permissions = ArchivaRoleConstants.OPERATION_MANAGE_CONFIGURATION )
     void setUiConfiguration( UiConfiguration uiConfiguration )
         throws ArchivaRestServiceException;
@@ -220,20 +232,20 @@ public interface ArchivaAdministrationService
     @GET
     @Produces( MediaType.TEXT_PLAIN )
     @RedbackAuthorization( noRestriction = true, noPermission = true )
-    String getApplicationUrl()
+    String getApplicationUrl( )
         throws ArchivaRestServiceException;
 
 
     @Path( "getNetworkConfiguration" )
     @GET
-    @Produces( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML } )
+    @Produces( {MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML} )
     @RedbackAuthorization( permissions = ArchivaRoleConstants.OPERATION_MANAGE_CONFIGURATION )
-    NetworkConfiguration getNetworkConfiguration()
+    NetworkConfiguration getNetworkConfiguration( )
         throws ArchivaRestServiceException;
 
     @Path( "setNetworkConfiguration" )
     @POST
-    @Consumes( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML } )
+    @Consumes( {MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML} )
     @RedbackAuthorization( permissions = ArchivaRoleConstants.OPERATION_MANAGE_CONFIGURATION )
     void setNetworkConfiguration( NetworkConfiguration networkConfiguration )
         throws ArchivaRestServiceException;
index f3f62740aae7509d6dbf10c97c3de22906099cdb..ba1f9466b03535859800548f6cb038b3e0cf23cc 100644 (file)
@@ -18,6 +18,7 @@ package org.apache.archiva.rest.api.services;
  * under the License.
  */
 
+import io.swagger.v3.oas.annotations.tags.Tag;
 import org.apache.archiva.admin.model.beans.ArchivaRuntimeConfiguration;
 import org.apache.archiva.redback.authorization.RedbackAuthorization;
 import org.apache.archiva.security.common.ArchivaRoleConstants;
@@ -34,6 +35,7 @@ import javax.ws.rs.core.MediaType;
  * @since 1.4-M4
  */
 @Path( "/archivaRuntimeConfigurationService/" )
+@Tag( name="Configuration" )
 public interface ArchivaRuntimeConfigurationService
 {
     @Path( "archivaRuntimeConfiguration" )
index cdb99eb384a9b5ea24f4b04ea0725323e32fe2ff..43d2d52dec85aeb2edbf689b20fefaa41ebf7e7f 100644 (file)
@@ -18,6 +18,7 @@ package org.apache.archiva.rest.api.services;
  * under the License.
  */
 
+import io.swagger.v3.oas.annotations.tags.Tag;
 import org.apache.archiva.admin.model.beans.ManagedRepository;
 import org.apache.archiva.maven2.model.Artifact;
 import org.apache.archiva.maven2.model.TreeEntry;
@@ -46,6 +47,7 @@ import java.util.List;
  * @since 1.4-M3
  */
 @Path("/browseService/")
+@Tag( name = "Browse", description = "Repository Browse Service")
 public interface BrowseService
 {
     @Path("rootGroups")
index 119f1215316b5d336b58d0f0a531a81563655cbd..9589a103b24cceefd6df88a20c6a3453c2e1ab60 100644 (file)
@@ -18,6 +18,7 @@ package org.apache.archiva.rest.api.services;
  * under the License.
  */
 
+import io.swagger.v3.oas.annotations.tags.Tag;
 import org.apache.archiva.redback.authorization.RedbackAuthorization;
 
 import javax.ws.rs.GET;
@@ -33,6 +34,7 @@ import javax.ws.rs.core.MediaType;
  * @since 1.4-M3
  */
 @Path( "/commonServices/" )
+@Tag( name="ArchivaCommon" )
 public interface CommonServices
 {
 
index c5dc6c8255ad08748325755b559792b9b8787103..c2df28337b1e35cfcf13bac9e46861552eedb9c6 100644 (file)
@@ -19,6 +19,8 @@ package org.apache.archiva.rest.api.services;
  * under the License.
  */
 
+import io.swagger.v3.oas.annotations.tags.Tag;
+import io.swagger.v3.oas.annotations.tags.Tags;
 import org.apache.archiva.admin.model.beans.ManagedRepository;
 import org.apache.archiva.redback.authorization.RedbackAuthorization;
 import org.apache.archiva.rest.api.model.ArchivaRepositoryStatistics;
@@ -39,6 +41,10 @@ import java.util.List;
  * @since 1.4-M1
  */
 @Path( "/managedRepositoriesService/" )
+@Tags( {
+    @Tag( name = "ManagedRepositories", description = "Administration for managed repositories" ),
+    @Tag( name = "Repositories" )
+})
 public interface ManagedRepositoriesService
 {
     @Path( "getManagedRepositories" )
index d2f4bb0b57201c778c99abc7b0605aa84db303bb..0d38133ba5e5cae52e19c9fac8c2f48ca23270b8 100644 (file)
@@ -18,6 +18,7 @@ package org.apache.archiva.rest.api.services;
  * under the License.
  */
 
+import io.swagger.v3.oas.annotations.tags.Tag;
 import org.apache.archiva.maven2.model.Artifact;
 import org.apache.archiva.redback.authorization.RedbackAuthorization;
 import org.apache.archiva.security.common.ArchivaRoleConstants;
@@ -36,6 +37,7 @@ import java.util.List;
  * @since 1.4-M3
  */
 @Path ("/mergeRepositoriesService/")
+@Tag(name="RepositoryMerge", description = "Merging repositories")
 public interface MergeRepositoriesService
 {
 
index b17c300892c148ee6e2c0f89aa1c425fb231b827..be5489e1dc044649d11fc287e1f70bbb99078d87 100644 (file)
@@ -18,6 +18,7 @@ package org.apache.archiva.rest.api.services;
  * under the License.
  */
 
+import io.swagger.v3.oas.annotations.tags.Tag;
 import org.apache.archiva.admin.model.beans.NetworkProxy;
 import org.apache.archiva.redback.authorization.RedbackAuthorization;
 import org.apache.archiva.security.common.ArchivaRoleConstants;
@@ -36,6 +37,7 @@ import java.util.List;
  * @since 1.4-M1
  */
 @Path( "/networkProxyService/" )
+@Tag(name="Proxy", description = "Managing Network Proxies")
 public interface NetworkProxyService
 {
     @Path( "getNetworkProxies" )
index ac36236d15b3d1ad0597e99d322fac2fd79b9e1e..b1016b8a03330bef0aa21394239422aba4c14b83 100644 (file)
@@ -19,6 +19,7 @@ package org.apache.archiva.rest.api.services;
  * under the License.
  */
 
+import io.swagger.v3.oas.annotations.tags.Tag;
 import org.apache.archiva.redback.authorization.RedbackAuthorization;
 
 import javax.ws.rs.GET;
@@ -31,6 +32,7 @@ import javax.ws.rs.core.MediaType;
  * @since 1.4-M1
  */
 @Path( "/pingService/" )
+@Tag(name="Ping")
 public interface PingService
 {
 
index 8748ee64e85ab4d30d423e168faf742d0fb0fdf3..7b105d09585aa7e5dda3f1f6d798083d78a4f926 100644 (file)
@@ -18,6 +18,7 @@ package org.apache.archiva.rest.api.services;
  * under the License.
  */
 
+import io.swagger.v3.oas.annotations.tags.Tag;
 import org.apache.archiva.redback.authorization.RedbackAuthorization;
 
 import javax.ws.rs.GET;
@@ -32,6 +33,7 @@ import javax.ws.rs.core.MediaType;
  * @since 1.4.0
  */
 @Path("/pluginsService/")
+@Tag( name="Plugins" )
 public interface PluginsService
 {
 
index 206525a029a5dad3f836637c692192b8ea040609..1399effd9b9f7860d2510c0fc00f6687a097cced 100644 (file)
@@ -18,6 +18,7 @@ package org.apache.archiva.rest.api.services;
  * under the License.
  */
 
+import io.swagger.v3.oas.annotations.tags.Tag;
 import org.apache.archiva.admin.model.beans.ProxyConnectorRule;
 import org.apache.archiva.redback.authorization.RedbackAuthorization;
 import org.apache.archiva.security.common.ArchivaRoleConstants;
@@ -37,6 +38,7 @@ import java.util.List;
  * @since 1.4-M3
  */
 @Path ( "/proxyConnectorRuleService/" )
+@Tag(name="Proxy-Repository", description="Handling of proxy repositories that delegate to remote repositories")
 public interface ProxyConnectorRuleService
 {
     @Path ( "proxyConnectorRules" )
index 5f63fd051a10305ec6aa3aef691a063cfc08b02d..b370d237e4520c541ccb09f8ee101fd7416993a5 100644 (file)
@@ -18,6 +18,7 @@ package org.apache.archiva.rest.api.services;
  * under the License.
  */
 
+import io.swagger.v3.oas.annotations.tags.Tag;
 import org.apache.archiva.admin.model.beans.ProxyConnector;
 import org.apache.archiva.redback.authorization.RedbackAuthorization;
 import org.apache.archiva.rest.api.model.PolicyInformation;
@@ -39,6 +40,7 @@ import java.util.List;
  * @since 1.4-M1
  */
 @Path( "/proxyConnectorService/" )
+@Tag(name="Proxy-Repository")
 public interface ProxyConnectorService
 {
     @Path( "getProxyConnectors" )
index dff24307e3684befa127fab2fa70741f551f8921..67f44ee0969b828913d849f58d83544bd50f8a38 100644 (file)
@@ -18,6 +18,7 @@ package org.apache.archiva.rest.api.services;
  * under the License.
  */
 
+import io.swagger.v3.oas.annotations.tags.Tag;
 import org.apache.archiva.admin.model.beans.LdapConfiguration;
 import org.apache.archiva.admin.model.beans.RedbackRuntimeConfiguration;
 import org.apache.archiva.redback.authorization.RedbackAuthorization;
@@ -40,6 +41,7 @@ import java.util.List;
  * @since 1.4-M4
  */
 @Path("/redbackRuntimeConfigurationService/")
+@Tag( name="Redback",description = "Configuration of Redback Backend")
 public interface RedbackRuntimeConfigurationService
 {
     @Path("redbackRuntimeConfiguration")
index 97aa4b9d20b0e4e9161e7a1e3c67e02757888055..632c8ff5171add24849c29b5d560efcc1f14319c 100644 (file)
@@ -19,6 +19,8 @@ package org.apache.archiva.rest.api.services;
  * under the License.
  */
 
+import io.swagger.v3.oas.annotations.tags.Tag;
+import io.swagger.v3.oas.annotations.tags.Tags;
 import org.apache.archiva.admin.model.beans.RemoteRepository;
 import org.apache.archiva.redback.authorization.RedbackAuthorization;
 import org.apache.archiva.security.common.ArchivaRoleConstants;
@@ -37,6 +39,10 @@ import java.util.List;
  * @since 1.4-M1
  */
 @Path("/remoteRepositoriesService/")
+@Tags( {
+    @Tag( name = "RemoteRepositories", description = "Administration of remote repositories" ),
+    @Tag( name = "Repositories", description = "Administration of remote repositories" )
+})
 public interface RemoteRepositoriesService
 {
     @Path("getRemoteRepositories")
index 5f3eccf34f689a3b95c97ac2ea4dae176bf45a21..da60650d3ee91536f06b40a2ba74eed641778065 100644 (file)
@@ -18,6 +18,7 @@ package org.apache.archiva.rest.api.services;
  * under the License.
  */
 
+import io.swagger.v3.oas.annotations.tags.Tag;
 import org.apache.archiva.metadata.model.facets.RepositoryProblemFacet;
 import org.apache.archiva.metadata.repository.stats.model.RepositoryStatistics;
 import org.apache.archiva.redback.authorization.RedbackAuthorization;
@@ -39,6 +40,7 @@ import java.util.List;
  * @since 1.4-M3
  */
 @Path( "/reportServices/" )
+@Tag( name="Statistics", description = "Statistics and Health reports")
 public interface ReportRepositoriesService
 {
 
index 9d48a0011681f1c3c1c6329f0cacb2a6ef0a7ae8..75e46701045a9b888116a760c2d65f27e1ea6af4 100644 (file)
@@ -19,6 +19,7 @@ package org.apache.archiva.rest.api.services;
  * under the License.
  */
 
+import io.swagger.v3.oas.annotations.tags.Tag;
 import org.apache.archiva.maven2.model.Artifact;
 import org.apache.archiva.redback.authorization.RedbackAuthorization;
 import org.apache.archiva.repository.scanner.RepositoryScanStatistics;
@@ -41,6 +42,7 @@ import javax.ws.rs.core.MediaType;
  * @since 1.4-M1
  */
 @Path ("/repositoriesService/")
+@Tag( name="Repositories", description = "Managing repositories")
 public interface RepositoriesService
 {
 
index f031d1c900f83462b850c04fa6648b8a82900f97..2daedc1956ef1efb347dfdf37e434c7bb8b6d46b 100644 (file)
@@ -18,6 +18,7 @@ package org.apache.archiva.rest.api.services;
  * under the License.
  */
 
+import io.swagger.v3.oas.annotations.tags.Tag;
 import org.apache.archiva.admin.model.beans.RepositoryGroup;
 import org.apache.archiva.redback.authorization.RedbackAuthorization;
 import org.apache.archiva.security.common.ArchivaRoleConstants;
@@ -37,6 +38,7 @@ import java.util.List;
  * @since 1.4-M1
  */
 @Path( "/repositoryGroupService/" )
+@Tag( name="Repository-Group", description = "Managing of groups of repositories")
 public interface RepositoryGroupService
 {
     @Path( "getRepositoriesGroups" )
index 1b3fa08b5b60a8bf2c1f2ab79f26fd7c70e04b9f..4d56d25595975018b8886c920ad212c7f967a6dd 100644 (file)
@@ -20,6 +20,7 @@ package org.apache.archiva.rest.api.services;
  */
 
 
+import io.swagger.v3.oas.annotations.tags.Tag;
 import org.apache.archiva.maven2.model.Artifact;
 import org.apache.archiva.redback.authorization.RedbackAuthorization;
 import org.apache.archiva.rest.api.model.ChecksumSearch;
@@ -37,6 +38,7 @@ import javax.ws.rs.core.Response;
 import java.util.List;
 
 @Path( "/searchService/" )
+@Tag( name="Search", description = "Searching repositories")
 public interface SearchService
 {
     /*
index ae1b02bbb764793534e59a27f80457e02a98ca01..96fe1d8667d181509666937ca2bd988875cfa309 100644 (file)
@@ -18,6 +18,7 @@ package org.apache.archiva.rest.api.services;
  * under the License.
  */
 
+import io.swagger.v3.oas.annotations.tags.Tag;
 import org.apache.archiva.redback.authorization.RedbackAuthorization;
 import org.apache.archiva.rest.api.model.CacheEntry;
 import org.apache.archiva.rest.api.model.QueueEntry;
@@ -36,6 +37,7 @@ import java.util.List;
  * @since 1.4-M3
  */
 @Path( "/systemStatusService/" )
+@Tag( name="System", description = "System information")
 public interface SystemStatusService
 {
     @Path( "memoryStatus" )
diff --git a/archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/resources/openapi-codegen-ignore b/archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/resources/openapi-codegen-ignore
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/resources/openapi-configuration.yaml b/archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/resources/openapi-configuration.yaml
new file mode 100644 (file)
index 0000000..80917c9
--- /dev/null
@@ -0,0 +1,16 @@
+resourcePackages:
+  - org.apache.archiva.rest.api
+prettyPrint: true
+cacheTTL: 0
+openAPI:
+  info:
+    version: '3.0'
+    title: Apache Archiva REST API
+    description: 'This is the Apache Archiva REST API documentation'
+    termsOfService: https://archiva.apache.org
+    contact:
+      email: dev@archiva.apache.org
+      url: https://archiva.apache.org/index.html
+    license:
+      name: Apache 2.0
+      url: http://www.apache.org/licenses/LICENSE-2.0.html
\ No newline at end of file
diff --git a/archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/resources/templates/bodyParam.mustache b/archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/resources/templates/bodyParam.mustache
new file mode 100644 (file)
index 0000000..4873e06
--- /dev/null
@@ -0,0 +1,4 @@
+{{#is this 'body-param'}}<div class="param">{{baseName}} {{#baseType}}<a href="#{{baseType}}">{{baseType}}</a>{{/baseType}} {{^required}}(optional){{/required}}{{#required}}(required){{/required}}</div>
+
+      <div class="param-desc"><span class="param-type">Body Parameter</span> &mdash; {{unescapedDescription}} {{#defaultValue}}default: {{{defaultValue}}}{{/defaultValue}}</div>{{/is}}
+      {{#example}}<div class="param-desc"><span class="param-type">example: <code>{{example}}</code></span></div>{{/example}}
\ No newline at end of file
diff --git a/archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/resources/templates/formParam.mustache b/archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/resources/templates/formParam.mustache
new file mode 100644 (file)
index 0000000..6d23f93
--- /dev/null
@@ -0,0 +1,3 @@
+{{#is this 'form-param'}}<div class="param">{{baseName}} {{^required}}(optional){{/required}}{{#required}}(required){{/required}}</div>
+
+      <div class="param-desc"><span class="param-type">Form Parameter</span> &mdash; {{unescapedDescription}} {{#defaultValue}}default: {{{defaultValue}}} {{/defaultValue}}{{#dataFormat}}format: {{{dataFormat}}}{{/dataFormat}}</div>{{/is}}
\ No newline at end of file
diff --git a/archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/resources/templates/headerParam.mustache b/archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/resources/templates/headerParam.mustache
new file mode 100644 (file)
index 0000000..ad00e3c
--- /dev/null
@@ -0,0 +1,3 @@
+{{#is this 'header-param'}}<div class="param">{{baseName}} {{^required}}(optional){{/required}}{{#required}}(required){{/required}}</div>
+
+      <div class="param-desc"><span class="param-type">Header Parameter</span> &mdash; {{unescapedDescription}} {{#defaultValue}}default: {{{defaultValue}}} {{/defaultValue}}{{#dataFormat}}format: {{{dataFormat}}}{{/dataFormat}}</div>{{/is}}
\ No newline at end of file
diff --git a/archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/resources/templates/index.mustache b/archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/resources/templates/index.mustache
new file mode 100644 (file)
index 0000000..59b27c8
--- /dev/null
@@ -0,0 +1,213 @@
+<!doctype html>
+<html>
+  <head>
+    <title>{{{appName}}}</title>
+    <style type="text/css">
+      {{>style.css}}
+    </style>
+  </head>
+  <body>
+  <h1>{{{appName}}}</h1>
+    <div class="app-desc">{{{appDescription}}}</div>
+    {{#infoUrl}}<div class="app-desc">More information: <a href="{{{infoUrl}}}">{{{infoUrl}}}</a></div>{{/infoUrl}}
+    {{#infoEmail}}<div class="app-desc">Contact Info: <a href="{{{infoEmail}}}">{{{infoEmail}}}</a></div>{{/infoEmail}}
+    {{#version}}<div class="app-desc">Version: {{{version}}}</div>{{/version}}
+    {{#basePathWithoutHost}}<div class="app-desc">BasePath:{{basePathWithoutHost}}</div>{{/basePathWithoutHost}}
+    <div class="license-info">{{{licenseInfo}}}</div>
+    <div class="license-url">{{{licenseUrl}}}</div>
+  <h2>Access</h2>
+  {{#hasAuthMethods}}
+    <ol>
+    {{#authMethods}}
+      <li>{{#is this 'basic'}}HTTP Basic Authentication{{/is}}{{#is this 'oauth'}}OAuth AuthorizationUrl:{{authorizationUrl}}TokenUrl:{{tokenUrl}}{{/is}}{{#is this 'api-key'}}APIKey KeyParamName:{{keyParamName}} KeyInQuery:{{isKeyInQuery}} KeyInHeader:{{isKeyInHeader}}{{/is}}</li>
+    {{/authMethods}}
+    </ol>
+  {{/hasAuthMethods}}
+
+  <h2><a name="__Methods">Methods</a></h2>
+  [ Jump to <a href="#__Models">Models</a> ]
+
+  {{! for the tables of content, I cheat and don't use CSS styles.... }}
+  <h3>Table of Contents </h3>
+  <div class="method-summary">{{access}}</div>
+  {{#apiInfo}}
+  {{#apis}}
+  {{#operations}}
+  <h4><a href="#{{baseName}}">{{baseName}}</a></h4>
+  <ul>
+  {{#operation}}
+  <li><a href="#{{nickname}}"><code><span class="http-method">{{httpMethod}}</span> {{path}}</code></a></li>
+  {{/operation}}
+  </ul>
+  {{/operations}}
+  {{/apis}}
+  {{/apiInfo}}
+
+  {{#apiInfo}}
+  {{#apis}}
+  {{#operations}}
+  <h1><a name="{{baseName}}">{{baseName}}</a></h1>
+  {{#operation}}
+  <div class="method"><a name="{{nickname}}"></a>
+    <div class="method-path">
+    <a class="up" href="#__Methods">Up</a>
+    <pre class="{{httpMethod}}"><code class="huge"><span class="http-method">{{httpMethod}}</span> {{path}}</code></pre></div>
+    <div class="method-summary">{{summary}} (<span class="nickname">{{nickname}}</span>)</div>
+    {{! notes is operation.description. So why rename it and make it super confusing???? }}
+    <div class="method-notes">{{notes}}</div>
+
+    {{#hasPathParams}}
+    <h3 class="field-label">Path parameters</h3>
+    <div class="field-items">
+      {{#pathParams}}{{>pathParam}}{{/pathParams}}
+    </div>  <!-- field-items -->
+    {{/hasPathParams}}
+
+    {{#has this 'consumes'}}
+    <h3 class="field-label">Consumes</h3>
+    This API call consumes the following media types via the <span class="header">Content-Type</span> request header:
+    <ul>
+    {{#consumes}}
+      <li><code>{{{mediaType}}}</code></li>
+    {{/consumes}}
+    </ul>
+    {{/has}}
+
+    {{#hasBodyParam}}
+    <h3 class="field-label">Request body</h3>
+    <div class="field-items">
+      {{#bodyParams}}{{>bodyParam}}{{/bodyParams}}
+    </div>  <!-- field-items -->
+    {{/hasBodyParam}}
+
+    {{#hasHeaderParams}}
+    <h3 class="field-label">Request headers</h3>
+    <div class="field-items">
+      {{#headerParam}}{{>headerParam}}{{/headerParam}}
+    </div>  <!-- field-items -->
+    {{/hasHeaderParams}}
+
+    {{#hasQueryParams}}
+    <h3 class="field-label">Query parameters</h3>
+    <div class="field-items">
+      {{#queryParams}}{{>queryParam}}{{/queryParams}}
+    </div>  <!-- field-items -->
+    {{/hasQueryParams}}
+
+    {{#hasFormParams}}
+    <h3 class="field-label">Form parameters</h3>
+    <div class="field-items">
+      {{#formParams}}{{>formParam}}{{/formParams}}
+    </div>  <!-- field-items -->
+    {{/hasFormParams}}
+
+    {{#returnType}}
+    <h3 class="field-label">Return type</h3>
+    <div class="return-type">
+      {{#hasReference}}{{^returnSimpleType}}{{returnContainer}}[{{/returnSimpleType}}<a href="#{{returnBaseType}}">{{returnBaseType}}</a>{{^returnSimpleType}}]{{/returnSimpleType}}{{/hasReference}}
+      {{^hasReference}}{{returnType}}{{/hasReference}}
+    </div>
+    {{/returnType}}
+
+    <!--Todo: process Response Object and its headers, schema, examples -->
+
+    {{#hasExamples}}
+    {{#examples}}
+    <h3 class="field-label">Example data</h3>
+    <div class="example-data-content-type">Content-Type: {{{contentType}}}</div>
+    <pre class="example"><code>{{{example}}}</code></pre>
+    {{/examples}}
+    {{/hasExamples}}
+
+    {{#has this 'produces'}}
+    <h3 class="field-label">Produces</h3>
+    This API call produces the following media types according to the <span class="header">Accept</span> request header;
+    the media type will be conveyed by the <span class="header">Content-Type</span> response header.
+    <ul>
+    {{#produces}}
+      <li><code>{{{mediaType}}}</code></li>
+    {{/produces}}
+    </ul>
+    {{/has}}
+
+    <h3 class="field-label">Responses</h3>
+    {{#responses}}
+    <h4 class="field-label">{{code}}</h4>
+    {{message}}
+        {{#simpleType}}<a href="#{{dataType}}">{{dataType}}</a>{{/simpleType}}
+    {{#examples}}
+    <h3 class="field-label">Example data</h3>
+    <div class="example-data-content-type">Content-Type: {{{contentType}}}</div>
+    <pre class="example"><code>{{example}}</code></pre>
+    {{/examples}}
+    {{/responses}}
+  </div> <!-- method -->
+  <hr/>
+  {{/operation}}
+  {{/operations}}
+  {{/apis}}
+  {{/apiInfo}}
+
+  <h2><a name="__Models">Models</a></h2>
+  [ Jump to <a href="#__Methods">Methods</a> ]
+
+  <h3>Table of Contents</h3>
+  <ol>
+  {{#models}}
+  {{#model}}
+    <li><a href="#{{name}}"><code>{{name}}</code>{{#title}} - {{title}}{{/title}}</a></li>
+  {{/model}}
+  {{/models}}
+  </ol>
+
+  {{#models}}
+  {{#model}}
+  <div class="model">
+    <h3><a name="{{name}}"><code>{{name}}</code>{{#title}} - {{title}}{{/title}}</a> <a class="up" href="#__Models">Up</a></h3>
+    {{#unescapedDescription}}<div class='model-description'>{{unescapedDescription}}</div>{{/unescapedDescription}}
+    <div class="field-items">
+      {{#vars}}<div class="param">{{name}} {{^required}}(optional){{/required}}</div><div class="param-desc"><span class="param-type">{{#isNot this 'primitive-type'}}<a href="#{{complexType}}">{{datatype}}</a>{{/isNot}}</span> {{unescapedDescription}} {{#dataFormat}}format: {{{dataFormat}}}{{/dataFormat}}</div>
+      {{#is this 'enum'}}
+        <div class="param-enum-header">Enum:</div>
+        {{#_enum}}<div class="param-enum">{{this}}</div>{{/_enum}}
+      {{/is}}
+      {{#example}}
+          <div class="param-desc"><span class="param-type">example: {{example}}</span></div>
+      {{/example}}
+      {{#vendorExtensions.oneOf-model}}
+      <div class="param-desc"><span class="param-type">oneOf:</span>
+          {{#vendorExtensions.x-model-names}}
+              <a href="#{{this}}"><code>{{this}}</code></a>&nbsp;&nbsp;&nbsp;
+          {{/vendorExtensions.x-model-names}}
+      </div>
+      {{/vendorExtensions.oneOf-model}}
+      {{#vendorExtensions.anyOf-model}}
+      <div class="param-desc"><span class="param-type">anyOf:</span>
+          {{#vendorExtensions.x-model-names}}
+              <a href="#{{this}}"><code>{{this}}</code></a>&nbsp;&nbsp;&nbsp;
+          {{/vendorExtensions.x-model-names}}
+      </div>
+      {{/vendorExtensions.anyOf-model}}
+      {{#items}}
+          {{#vendorExtensions.oneOf-model}}
+              <div class="param-desc"><span class="param-type">items oneOf:</span>
+              {{#vendorExtensions.x-model-names}}
+                  <a href="#{{this}}"><code>{{this}}</code></a>&nbsp;&nbsp;&nbsp;
+              {{/vendorExtensions.x-model-names}}
+              </div>
+          {{/vendorExtensions.oneOf-model}}
+          {{#vendorExtensions.anyOf-model}}
+              <div class="param-desc"><span class="param-type">items anyOf:</span>
+              {{#vendorExtensions.x-model-names}}
+                  <a href="#{{this}}"><code>{{this}}</code></a>&nbsp;&nbsp;&nbsp;
+              {{/vendorExtensions.x-model-names}}
+              </div>
+          {{/vendorExtensions.anyOf-model}}
+      {{/items}}
+      {{/vars}}
+    </div>  <!-- field-items -->
+  </div>
+  {{/model}}
+  {{/models}}
+  </body>
+</html>
diff --git a/archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/resources/templates/pathParam.mustache b/archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/resources/templates/pathParam.mustache
new file mode 100644 (file)
index 0000000..fa512bf
--- /dev/null
@@ -0,0 +1,3 @@
+{{#is this 'path-param'}}<div class="param">{{baseName}} {{^required}}(optional){{/required}}{{#required}}(required){{/required}}</div>
+
+      <div class="param-desc"><span class="param-type">Path Parameter</span> &mdash; {{unescapedDescription}} {{#defaultValue}}default: {{{defaultValue}}} {{/defaultValue}}{{#dataFormat}}format: {{{dataFormat}}}{{/dataFormat}}</div>{{/is}}
\ No newline at end of file
diff --git a/archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/resources/templates/queryParam.mustache b/archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/resources/templates/queryParam.mustache
new file mode 100644 (file)
index 0000000..ee9f48a
--- /dev/null
@@ -0,0 +1,3 @@
+{{#is this 'query-param'}}<div class="param">{{baseName}} {{^required}}(optional){{/required}}{{#required}}(required){{/required}}</div>
+
+      <div class="param-desc"><span class="param-type">Query Parameter</span> &mdash; {{unescapedDescription}} {{#defaultValue}}default: {{{defaultValue}}} {{/defaultValue}}{{#dataFormat}}format: {{{dataFormat}}}{{/dataFormat}}</div>{{/is}}
\ No newline at end of file
diff --git a/archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/resources/templates/style.css.mustache b/archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/resources/templates/style.css.mustache
new file mode 100644 (file)
index 0000000..04eccf6
--- /dev/null
@@ -0,0 +1,172 @@
+body {
+       font-family: Trebuchet MS, sans-serif;
+       font-size: 15px;
+       color: #444;
+       margin-right: 24px;
+}
+
+h1     {
+       font-size: 25px;
+}
+h2     {
+       font-size: 20px;
+}
+h3     {
+       font-size: 16px;
+       font-weight: bold;
+}
+hr     {
+       height: 1px;
+       border: 0;
+       color: #ddd;
+       background-color: #ddd;
+}
+
+.app-desc {
+  clear: both;
+  margin-left: 20px;
+}
+.param-name {
+  width: 100%;
+}
+.license-info {
+  margin-left: 20px;
+}
+
+.license-url {
+  margin-left: 20px;
+}
+
+.model {
+  margin: 0 0 0px 20px;
+}
+
+.method {
+  margin-left: 20px;
+}
+
+.method-notes  {
+       margin: 10px 0 20px 0;
+       font-size: 90%;
+       color: #555;
+}
+
+pre {
+  padding: 10px;
+  margin-bottom: 2px;
+}
+
+.http-method {
+ text-transform: uppercase;
+}
+
+pre.get {
+  background-color: #0f6ab4;
+}
+
+pre.post {
+  background-color: #10a54a;
+}
+
+pre.put {
+  background-color: #c5862b;
+}
+
+pre.delete {
+  background-color: #a41e22;
+}
+
+.huge  {
+       color: #fff;
+}
+
+pre.example {
+  background-color: #f3f3f3;
+  padding: 10px;
+  border: 1px solid #ddd;
+}
+
+code {
+  white-space: pre;
+}
+
+.nickname {
+  font-weight: bold;
+}
+
+.method-path {
+  font-size: 1.5em;
+  background-color: #0f6ab4;
+}
+
+.up {
+  float:right;
+}
+
+.parameter {
+  width: 500px;
+}
+
+.param {
+  width: 500px;
+  padding: 10px 0 0 20px;
+  font-weight: bold;
+}
+
+.param-desc {
+  width: 700px;
+  padding: 0 0 0 20px;
+  color: #777;
+}
+
+.param-type {
+  font-style: italic;
+}
+
+.param-enum-header {
+width: 700px;
+padding: 0 0 0 60px;
+color: #777;
+font-weight: bold;
+}
+
+.param-enum {
+width: 700px;
+padding: 0 0 0 80px;
+color: #777;
+font-style: italic;
+}
+
+.field-label {
+  padding: 0;
+  margin: 0;
+  clear: both;
+}
+
+.field-items   {
+       padding: 0 0 15px 0;
+       margin-bottom: 15px;
+}
+
+.return-type {
+  clear: both;
+  padding-bottom: 10px;
+}
+
+.param-header {
+  font-weight: bold;
+}
+
+.method-tags {
+  text-align: right;
+}
+
+.method-tag {
+  background: none repeat scroll 0% 0% #24A600;
+  border-radius: 3px;
+  padding: 2px 10px;
+  margin: 2px;
+  color: #FFF;
+  display: inline-block;
+  text-decoration: none;
+}
index a806a439cf5d62fcf886610a1ea669d4395a4156..1651becd494852236d5e1bc6042942443747bad9 100644 (file)
@@ -4,40 +4,31 @@
 
 archiva-modules
   archiva-base
-    archiva-common
-    archiva-storage-api
-    archiva-storage-fs
-    archiva-filelock
-    archiva-model
     archiva-checksum
-    archiva-policies
+    archiva-common
     archiva-configuration
-    archiva-repository-api
-    archiva-xml-tools
-    archiva-repository-layer
-    archiva-proxy-api
-    archiva-proxy
-    archiva-repository-scanner
-    archiva-security-common
     archiva-consumers
       archiva-consumers-api
+      archiva-consumer-archetype
       archiva-core-consumers
+      archiva-lucene-consumer
       archiva-metadata-consumer
       archiva-signature-consumer
-      archiva-lucene-consumer
-      archiva-consumer-archetype
+    archiva-filelock
+    archiva-model
+    archiva-policies
+    archiva-proxy
+    archiva-proxy-api
+    archiva-repository-api
     archiva-repository-admin
       archiva-repository-admin-api
       archiva-repository-admin-default
-  archiva-scheduler
-    archiva-scheduler-api
-    archiva-scheduler-repository-api
-    archiva-scheduler-repository
-    archiva-scheduler-indexer
-  metadata
-    metadata-statistics-api
-    metadata-repository-api
-    metadata-model
+    archiva-repository-layer
+    archiva-repository-scanner
+    archiva-security-common
+    archiva-storage-api
+    archiva-storage-fs
+    archiva-xml-tools
   archiva-maven
     archiva-maven-common
     archiva-maven-model
@@ -47,15 +38,25 @@ archiva-modules
     archiva-maven-indexer
     archiva-maven-repository
     archiva-maven-scheduler
+  archiva-scheduler
+    archiva-scheduler-api
+    archiva-scheduler-indexer
+    archiva-scheduler-repository-api
+    archiva-scheduler-repository
+  metadata
+    metadata-model
+    metadata-repository-api
+    metadata-statistics-api
+    test-repository
   plugins
+    audit
     generic-metadata-support
+    metadata-store-cassandra
+    metadata-store-file
     metadata-store-jcr
+    problem-reports
     repository-statistics
     stage-repository-merge
-    metadata-store-file
-    audit
-    problem-reports
-    metadata-store-cassandra