From 167c3358564295ec3e28113bb9242d28500674ea Mon Sep 17 00:00:00 2001 From: Martin Stockhammer Date: Mon, 22 Jun 2020 20:08:22 +0200 Subject: [PATCH] Moving from enunciate to OpenAPI documentation --- .../archiva-rest/archiva-rest-api/pom.xml | 134 ++++++++++- .../{enunciate.xml => enunciate.xml.org} | 2 + .../ArchivaAdministrationService.java | 86 ++++--- .../ArchivaRuntimeConfigurationService.java | 2 + .../rest/api/services/BrowseService.java | 2 + .../rest/api/services/CommonServices.java | 2 + .../services/ManagedRepositoriesService.java | 6 + .../services/MergeRepositoriesService.java | 2 + .../api/services/NetworkProxyService.java | 2 + .../rest/api/services/PingService.java | 2 + .../rest/api/services/PluginsService.java | 2 + .../services/ProxyConnectorRuleService.java | 2 + .../api/services/ProxyConnectorService.java | 2 + .../RedbackRuntimeConfigurationService.java | 2 + .../services/RemoteRepositoriesService.java | 6 + .../services/ReportRepositoriesService.java | 2 + .../api/services/RepositoriesService.java | 2 + .../api/services/RepositoryGroupService.java | 2 + .../rest/api/services/SearchService.java | 2 + .../api/services/SystemStatusService.java | 2 + .../src/main/resources/openapi-codegen-ignore | 0 .../main/resources/openapi-configuration.yaml | 16 ++ .../resources/templates/bodyParam.mustache | 4 + .../resources/templates/formParam.mustache | 3 + .../resources/templates/headerParam.mustache | 3 + .../main/resources/templates/index.mustache | 213 ++++++++++++++++++ .../resources/templates/pathParam.mustache | 3 + .../resources/templates/queryParam.mustache | 3 + .../resources/templates/style.css.mustache | 172 ++++++++++++++ status-dep.txt | 57 ++--- 30 files changed, 664 insertions(+), 74 deletions(-) rename archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/enunciate/{enunciate.xml => enunciate.xml.org} (94%) create mode 100644 archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/resources/openapi-codegen-ignore create mode 100644 archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/resources/openapi-configuration.yaml create mode 100644 archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/resources/templates/bodyParam.mustache create mode 100644 archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/resources/templates/formParam.mustache create mode 100644 archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/resources/templates/headerParam.mustache create mode 100644 archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/resources/templates/index.mustache create mode 100644 archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/resources/templates/pathParam.mustache create mode 100644 archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/resources/templates/queryParam.mustache create mode 100644 archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/resources/templates/style.css.mustache diff --git a/archiva-modules/archiva-web/archiva-rest/archiva-rest-api/pom.xml b/archiva-modules/archiva-web/archiva-rest/archiva-rest-api/pom.xml index e50ff83e7..9a64d1d50 100644 --- a/archiva-modules/archiva-web/archiva-rest/archiva-rest-api/pom.xml +++ b/archiva-modules/archiva-web/archiva-rest/archiva-rest-api/pom.xml @@ -31,50 +31,43 @@ ${project.build.outputDirectory}/rest-docs-archiva-rest-api ${project.parent.parent.parent.basedir} + 2.1.2 + 2.1.2 org.apache.archiva archiva-security-common - - org.apache.archiva archiva-repository-admin-api - org.apache.archiva archiva-policies - org.apache.archiva metadata-model - org.apache.archiva.maven archiva-maven-model - org.apache.archiva archiva-repository-scanner - org.apache.archiva repository-statistics - org.apache.archiva metadata-statistics-api - org.apache.archiva.redback redback-authorization-api @@ -89,6 +82,42 @@ javax.ws.rs javax.ws.rs-api + + io.swagger.core.v3 + swagger-core + compile + ${io.swagger.version} + + + javax.ws.rs + jsr311-api + + + + + io.swagger.core.v3 + swagger-jaxrs2 + ${io.swagger.version} + + + javax.ws.rs + jsr311-api + + + + + io.swagger.core.v3 + swagger-annotations + ${io.swagger.version} + + + javax.ws.rs + jsr311-api + + + + + org.apache.cxf @@ -104,6 +133,17 @@ + + org.apache.rat + apache-rat-plugin + + + target/generated + src/main/resources/templates/* + src/main/resources/openapi-codegen-ignore + + + org.apache.maven.plugins maven-source-plugin @@ -116,7 +156,83 @@ + + io.swagger.core.v3 + swagger-maven-plugin + ${swagger-maven-plugin-version} + + openapi + ${project.build.directory}/generated + JSONANDYAML + + org.apache.archiva.rest.api + + TRUE + ${project.basedir}/src/main/resources/openapi-configuration.yaml + + + + compile + + resolve + + + + + + + io.swagger.codegen.v3 + swagger-codegen-maven-plugin + 3.0.20 + + + compile + + generate + + + ${project.build.directory}/generated/openapi.yaml + html + ${project.build.directory}/generated-sources + ${project.basedir}/src/main/resources/openapi-codegen-ignore + ${project.basedir}/src/main/resources/templates + index.html,index2.html + + + + + + maven-resources-plugin + 3.1.0 + + + copy-resources + site + + copy-resources + + + ${basedir}/target/site/openapi/ + + + ${project.build.directory}/generated + false + openapi.json + openapi.yaml + + + ${project.build.directory}/generated-sources/ + false + **/* + .swagger-codegen/** + .swagger-codegen-ignore + + + + + + 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.org similarity index 94% rename from archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/enunciate/enunciate.xml rename to archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/enunciate/enunciate.xml.org index c0f27aad4..3e1fe0605 100644 --- 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.org @@ -23,6 +23,8 @@ Apache Archiva REST API + + diff --git a/archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/java/org/apache/archiva/rest/api/services/ArchivaAdministrationService.java b/archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/java/org/apache/archiva/rest/api/services/ArchivaAdministrationService.java index 612ed0a96..77544cc8e 100644 --- a/archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/java/org/apache/archiva/rest/api/services/ArchivaAdministrationService.java +++ b/archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/java/org/apache/archiva/rest/api/services/ArchivaAdministrationService.java @@ -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 getLegacyArtifactPaths() + List 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 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 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 getFileTypes() + List 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 getKnownContentConsumers() + List 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 getKnownContentAdminRepositoryConsumers() + List 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 getInvalidContentAdminRepositoryConsumers() + List 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 getInvalidContentConsumers() + List 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; diff --git a/archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/java/org/apache/archiva/rest/api/services/ArchivaRuntimeConfigurationService.java b/archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/java/org/apache/archiva/rest/api/services/ArchivaRuntimeConfigurationService.java index f3f62740a..ba1f9466b 100644 --- a/archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/java/org/apache/archiva/rest/api/services/ArchivaRuntimeConfigurationService.java +++ b/archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/java/org/apache/archiva/rest/api/services/ArchivaRuntimeConfigurationService.java @@ -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" ) diff --git a/archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/java/org/apache/archiva/rest/api/services/BrowseService.java b/archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/java/org/apache/archiva/rest/api/services/BrowseService.java index cdb99eb38..43d2d52de 100644 --- a/archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/java/org/apache/archiva/rest/api/services/BrowseService.java +++ b/archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/java/org/apache/archiva/rest/api/services/BrowseService.java @@ -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") diff --git a/archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/java/org/apache/archiva/rest/api/services/CommonServices.java b/archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/java/org/apache/archiva/rest/api/services/CommonServices.java index 119f12153..9589a103b 100644 --- a/archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/java/org/apache/archiva/rest/api/services/CommonServices.java +++ b/archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/java/org/apache/archiva/rest/api/services/CommonServices.java @@ -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 { diff --git a/archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/java/org/apache/archiva/rest/api/services/ManagedRepositoriesService.java b/archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/java/org/apache/archiva/rest/api/services/ManagedRepositoriesService.java index c5dc6c825..c2df28337 100644 --- a/archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/java/org/apache/archiva/rest/api/services/ManagedRepositoriesService.java +++ b/archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/java/org/apache/archiva/rest/api/services/ManagedRepositoriesService.java @@ -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" ) diff --git a/archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/java/org/apache/archiva/rest/api/services/MergeRepositoriesService.java b/archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/java/org/apache/archiva/rest/api/services/MergeRepositoriesService.java index d2f4bb0b5..0d38133ba 100644 --- a/archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/java/org/apache/archiva/rest/api/services/MergeRepositoriesService.java +++ b/archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/java/org/apache/archiva/rest/api/services/MergeRepositoriesService.java @@ -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 { diff --git a/archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/java/org/apache/archiva/rest/api/services/NetworkProxyService.java b/archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/java/org/apache/archiva/rest/api/services/NetworkProxyService.java index b17c30089..be5489e1d 100644 --- a/archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/java/org/apache/archiva/rest/api/services/NetworkProxyService.java +++ b/archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/java/org/apache/archiva/rest/api/services/NetworkProxyService.java @@ -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" ) diff --git a/archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/java/org/apache/archiva/rest/api/services/PingService.java b/archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/java/org/apache/archiva/rest/api/services/PingService.java index ac36236d1..b1016b8a0 100644 --- a/archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/java/org/apache/archiva/rest/api/services/PingService.java +++ b/archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/java/org/apache/archiva/rest/api/services/PingService.java @@ -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 { diff --git a/archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/java/org/apache/archiva/rest/api/services/PluginsService.java b/archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/java/org/apache/archiva/rest/api/services/PluginsService.java index 8748ee64e..7b105d095 100644 --- a/archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/java/org/apache/archiva/rest/api/services/PluginsService.java +++ b/archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/java/org/apache/archiva/rest/api/services/PluginsService.java @@ -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 { diff --git a/archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/java/org/apache/archiva/rest/api/services/ProxyConnectorRuleService.java b/archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/java/org/apache/archiva/rest/api/services/ProxyConnectorRuleService.java index 206525a02..1399effd9 100644 --- a/archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/java/org/apache/archiva/rest/api/services/ProxyConnectorRuleService.java +++ b/archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/java/org/apache/archiva/rest/api/services/ProxyConnectorRuleService.java @@ -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" ) diff --git a/archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/java/org/apache/archiva/rest/api/services/ProxyConnectorService.java b/archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/java/org/apache/archiva/rest/api/services/ProxyConnectorService.java index 5f63fd051..b370d237e 100644 --- a/archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/java/org/apache/archiva/rest/api/services/ProxyConnectorService.java +++ b/archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/java/org/apache/archiva/rest/api/services/ProxyConnectorService.java @@ -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" ) diff --git a/archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/java/org/apache/archiva/rest/api/services/RedbackRuntimeConfigurationService.java b/archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/java/org/apache/archiva/rest/api/services/RedbackRuntimeConfigurationService.java index dff24307e..67f44ee09 100644 --- a/archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/java/org/apache/archiva/rest/api/services/RedbackRuntimeConfigurationService.java +++ b/archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/java/org/apache/archiva/rest/api/services/RedbackRuntimeConfigurationService.java @@ -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") diff --git a/archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/java/org/apache/archiva/rest/api/services/RemoteRepositoriesService.java b/archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/java/org/apache/archiva/rest/api/services/RemoteRepositoriesService.java index 97aa4b9d2..632c8ff51 100644 --- a/archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/java/org/apache/archiva/rest/api/services/RemoteRepositoriesService.java +++ b/archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/java/org/apache/archiva/rest/api/services/RemoteRepositoriesService.java @@ -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") diff --git a/archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/java/org/apache/archiva/rest/api/services/ReportRepositoriesService.java b/archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/java/org/apache/archiva/rest/api/services/ReportRepositoriesService.java index 5f3eccf34..da60650d3 100644 --- a/archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/java/org/apache/archiva/rest/api/services/ReportRepositoriesService.java +++ b/archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/java/org/apache/archiva/rest/api/services/ReportRepositoriesService.java @@ -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 { diff --git a/archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/java/org/apache/archiva/rest/api/services/RepositoriesService.java b/archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/java/org/apache/archiva/rest/api/services/RepositoriesService.java index 9d48a0011..75e467010 100644 --- a/archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/java/org/apache/archiva/rest/api/services/RepositoriesService.java +++ b/archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/java/org/apache/archiva/rest/api/services/RepositoriesService.java @@ -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 { diff --git a/archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/java/org/apache/archiva/rest/api/services/RepositoryGroupService.java b/archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/java/org/apache/archiva/rest/api/services/RepositoryGroupService.java index f031d1c90..2daedc195 100644 --- a/archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/java/org/apache/archiva/rest/api/services/RepositoryGroupService.java +++ b/archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/java/org/apache/archiva/rest/api/services/RepositoryGroupService.java @@ -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" ) diff --git a/archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/java/org/apache/archiva/rest/api/services/SearchService.java b/archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/java/org/apache/archiva/rest/api/services/SearchService.java index 1b3fa08b5..4d56d2559 100644 --- a/archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/java/org/apache/archiva/rest/api/services/SearchService.java +++ b/archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/java/org/apache/archiva/rest/api/services/SearchService.java @@ -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 { /* diff --git a/archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/java/org/apache/archiva/rest/api/services/SystemStatusService.java b/archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/java/org/apache/archiva/rest/api/services/SystemStatusService.java index ae1b02bbb..96fe1d866 100644 --- a/archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/java/org/apache/archiva/rest/api/services/SystemStatusService.java +++ b/archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/java/org/apache/archiva/rest/api/services/SystemStatusService.java @@ -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 index 000000000..e69de29bb 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 index 000000000..80917c951 --- /dev/null +++ b/archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/resources/openapi-configuration.yaml @@ -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 index 000000000..4873e06ed --- /dev/null +++ b/archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/resources/templates/bodyParam.mustache @@ -0,0 +1,4 @@ +{{#is this 'body-param'}}
{{baseName}} {{#baseType}}{{baseType}}{{/baseType}} {{^required}}(optional){{/required}}{{#required}}(required){{/required}}
+ +
Body Parameter — {{unescapedDescription}} {{#defaultValue}}default: {{{defaultValue}}}{{/defaultValue}}
{{/is}} + {{#example}}
example: {{example}}
{{/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 index 000000000..6d23f9338 --- /dev/null +++ b/archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/resources/templates/formParam.mustache @@ -0,0 +1,3 @@ +{{#is this 'form-param'}}
{{baseName}} {{^required}}(optional){{/required}}{{#required}}(required){{/required}}
+ +
Form Parameter — {{unescapedDescription}} {{#defaultValue}}default: {{{defaultValue}}} {{/defaultValue}}{{#dataFormat}}format: {{{dataFormat}}}{{/dataFormat}}
{{/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 index 000000000..ad00e3cbc --- /dev/null +++ b/archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/resources/templates/headerParam.mustache @@ -0,0 +1,3 @@ +{{#is this 'header-param'}}
{{baseName}} {{^required}}(optional){{/required}}{{#required}}(required){{/required}}
+ +
Header Parameter — {{unescapedDescription}} {{#defaultValue}}default: {{{defaultValue}}} {{/defaultValue}}{{#dataFormat}}format: {{{dataFormat}}}{{/dataFormat}}
{{/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 index 000000000..59b27c891 --- /dev/null +++ b/archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/resources/templates/index.mustache @@ -0,0 +1,213 @@ + + + + {{{appName}}} + + + +

{{{appName}}}

+
{{{appDescription}}}
+ {{#infoUrl}}
More information: {{{infoUrl}}}
{{/infoUrl}} + {{#infoEmail}}
Contact Info: {{{infoEmail}}}
{{/infoEmail}} + {{#version}}
Version: {{{version}}}
{{/version}} + {{#basePathWithoutHost}}
BasePath:{{basePathWithoutHost}}
{{/basePathWithoutHost}} +
{{{licenseInfo}}}
+
{{{licenseUrl}}}
+

Access

+ {{#hasAuthMethods}} +
    + {{#authMethods}} +
  1. {{#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}}
  2. + {{/authMethods}} +
+ {{/hasAuthMethods}} + +

Methods

+ [ Jump to Models ] + + {{! for the tables of content, I cheat and don't use CSS styles.... }} +

Table of Contents

+
{{access}}
+ {{#apiInfo}} + {{#apis}} + {{#operations}} +

{{baseName}}

+ + {{/operations}} + {{/apis}} + {{/apiInfo}} + + {{#apiInfo}} + {{#apis}} + {{#operations}} +

{{baseName}}

+ {{#operation}} +
+
+ Up +
{{httpMethod}} {{path}}
+
{{summary}} ({{nickname}})
+ {{! notes is operation.description. So why rename it and make it super confusing???? }} +
{{notes}}
+ + {{#hasPathParams}} +

Path parameters

+
+ {{#pathParams}}{{>pathParam}}{{/pathParams}} +
+ {{/hasPathParams}} + + {{#has this 'consumes'}} +

Consumes

+ This API call consumes the following media types via the Content-Type request header: +
    + {{#consumes}} +
  • {{{mediaType}}}
  • + {{/consumes}} +
+ {{/has}} + + {{#hasBodyParam}} +

Request body

+
+ {{#bodyParams}}{{>bodyParam}}{{/bodyParams}} +
+ {{/hasBodyParam}} + + {{#hasHeaderParams}} +

Request headers

+
+ {{#headerParam}}{{>headerParam}}{{/headerParam}} +
+ {{/hasHeaderParams}} + + {{#hasQueryParams}} +

Query parameters

+
+ {{#queryParams}}{{>queryParam}}{{/queryParams}} +
+ {{/hasQueryParams}} + + {{#hasFormParams}} +

Form parameters

+
+ {{#formParams}}{{>formParam}}{{/formParams}} +
+ {{/hasFormParams}} + + {{#returnType}} +

Return type

+
+ {{#hasReference}}{{^returnSimpleType}}{{returnContainer}}[{{/returnSimpleType}}{{returnBaseType}}{{^returnSimpleType}}]{{/returnSimpleType}}{{/hasReference}} + {{^hasReference}}{{returnType}}{{/hasReference}} +
+ {{/returnType}} + + + + {{#hasExamples}} + {{#examples}} +

Example data

+
Content-Type: {{{contentType}}}
+
{{{example}}}
+ {{/examples}} + {{/hasExamples}} + + {{#has this 'produces'}} +

Produces

+ This API call produces the following media types according to the Accept request header; + the media type will be conveyed by the Content-Type response header. +
    + {{#produces}} +
  • {{{mediaType}}}
  • + {{/produces}} +
+ {{/has}} + +

Responses

+ {{#responses}} +

{{code}}

+ {{message}} + {{#simpleType}}{{dataType}}{{/simpleType}} + {{#examples}} +

Example data

+
Content-Type: {{{contentType}}}
+
{{example}}
+ {{/examples}} + {{/responses}} +
+
+ {{/operation}} + {{/operations}} + {{/apis}} + {{/apiInfo}} + +

Models

+ [ Jump to Methods ] + +

Table of Contents

+
    + {{#models}} + {{#model}} +
  1. {{name}}{{#title}} - {{title}}{{/title}}
  2. + {{/model}} + {{/models}} +
+ + {{#models}} + {{#model}} +
+

{{name}}{{#title}} - {{title}}{{/title}} Up

+ {{#unescapedDescription}}
{{unescapedDescription}}
{{/unescapedDescription}} +
+ {{#vars}}
{{name}} {{^required}}(optional){{/required}}
{{#isNot this 'primitive-type'}}{{datatype}}{{/isNot}} {{unescapedDescription}} {{#dataFormat}}format: {{{dataFormat}}}{{/dataFormat}}
+ {{#is this 'enum'}} +
Enum:
+ {{#_enum}}
{{this}}
{{/_enum}} + {{/is}} + {{#example}} +
example: {{example}}
+ {{/example}} + {{#vendorExtensions.oneOf-model}} +
oneOf: + {{#vendorExtensions.x-model-names}} + {{this}}    + {{/vendorExtensions.x-model-names}} +
+ {{/vendorExtensions.oneOf-model}} + {{#vendorExtensions.anyOf-model}} +
anyOf: + {{#vendorExtensions.x-model-names}} + {{this}}    + {{/vendorExtensions.x-model-names}} +
+ {{/vendorExtensions.anyOf-model}} + {{#items}} + {{#vendorExtensions.oneOf-model}} +
items oneOf: + {{#vendorExtensions.x-model-names}} + {{this}}    + {{/vendorExtensions.x-model-names}} +
+ {{/vendorExtensions.oneOf-model}} + {{#vendorExtensions.anyOf-model}} +
items anyOf: + {{#vendorExtensions.x-model-names}} + {{this}}    + {{/vendorExtensions.x-model-names}} +
+ {{/vendorExtensions.anyOf-model}} + {{/items}} + {{/vars}} +
+
+ {{/model}} + {{/models}} + + 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 index 000000000..fa512bfd3 --- /dev/null +++ b/archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/resources/templates/pathParam.mustache @@ -0,0 +1,3 @@ +{{#is this 'path-param'}}
{{baseName}} {{^required}}(optional){{/required}}{{#required}}(required){{/required}}
+ +
Path Parameter — {{unescapedDescription}} {{#defaultValue}}default: {{{defaultValue}}} {{/defaultValue}}{{#dataFormat}}format: {{{dataFormat}}}{{/dataFormat}}
{{/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 index 000000000..ee9f48a78 --- /dev/null +++ b/archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/resources/templates/queryParam.mustache @@ -0,0 +1,3 @@ +{{#is this 'query-param'}}
{{baseName}} {{^required}}(optional){{/required}}{{#required}}(required){{/required}}
+ +
Query Parameter — {{unescapedDescription}} {{#defaultValue}}default: {{{defaultValue}}} {{/defaultValue}}{{#dataFormat}}format: {{{dataFormat}}}{{/dataFormat}}
{{/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 index 000000000..04eccf694 --- /dev/null +++ b/archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/resources/templates/style.css.mustache @@ -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; +} diff --git a/status-dep.txt b/status-dep.txt index a806a439c..1651becd4 100644 --- a/status-dep.txt +++ b/status-dep.txt @@ -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 -- 2.39.5