aboutsummaryrefslogtreecommitdiffstats
path: root/main/src/main/java/org/onap/policy/pap/main/rest/PapRestControllerV1.java
diff options
context:
space:
mode:
authorlapentafd <francesco.lapenta@est.tech>2023-01-09 15:16:54 +0000
committerlapentafd <francesco.lapenta@est.tech>2023-01-17 09:15:20 +0000
commit09191f108632a46862ea7c60023ea5d012a81823 (patch)
tree80ce5cbf4fc64e69c13b6107712298472cc10b07 /main/src/main/java/org/onap/policy/pap/main/rest/PapRestControllerV1.java
parent7c48007486d0d1ee47a5eea81135e49737677155 (diff)
Use generated PAP interface for Swagger
This commit removes the Swagger V2 annotations on the Rest Controllers in policy-pap. The OpeApi annotations (Swagger v3 annotations) are on a generated Java Interface. The code is changed so that the controller implements that interface. There are minimal code changes to the controller and the order of the parameters is switched in some cases. Issue-ID: POLICY-4404 Change-Id: I060709806a8e5bc04d9873c8d212a5c9fe13c4d4 Signed-off-by: lapentafd <francesco.lapenta@est.tech>
Diffstat (limited to 'main/src/main/java/org/onap/policy/pap/main/rest/PapRestControllerV1.java')
-rw-r--r--main/src/main/java/org/onap/policy/pap/main/rest/PapRestControllerV1.java25
1 files changed, 3 insertions, 22 deletions
diff --git a/main/src/main/java/org/onap/policy/pap/main/rest/PapRestControllerV1.java b/main/src/main/java/org/onap/policy/pap/main/rest/PapRestControllerV1.java
index 01b539e3..3dd9c360 100644
--- a/main/src/main/java/org/onap/policy/pap/main/rest/PapRestControllerV1.java
+++ b/main/src/main/java/org/onap/policy/pap/main/rest/PapRestControllerV1.java
@@ -1,6 +1,6 @@
/*-
* ============LICENSE_START=======================================================
- * Copyright (C) 2019-2022 Nordix Foundation.
+ * Copyright (C) 2019-2023 Nordix Foundation.
* Modifications Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
* Modifications Copyright (C) 2021 Bell Canada. All rights reserved.
* ================================================================================
@@ -22,40 +22,21 @@
package org.onap.policy.pap.main.rest;
-import io.swagger.annotations.BasicAuthDefinition;
-import io.swagger.annotations.Info;
-import io.swagger.annotations.SecurityDefinition;
-import io.swagger.annotations.SwaggerDefinition;
-import io.swagger.annotations.Tag;
import java.net.HttpURLConnection;
import java.util.Objects;
import java.util.UUID;
-import javax.ws.rs.core.MediaType;
import org.onap.policy.models.base.PfModelException;
import org.springframework.http.ResponseEntity.BodyBuilder;
import org.springframework.security.core.Authentication;
import org.springframework.security.core.context.SecurityContextHolder;
+import org.springframework.web.bind.annotation.RequestMapping;
/**
* Version v1 common superclass to provide REST endpoints for PAP component.
*
* @author Ram Krishna Verma (ram.krishna.verma@est.tech)
*/
-// @formatter:off
-@SwaggerDefinition(
- info = @Info(description =
- "Policy Administration is responsible for the deployment life cycle of policies as well as "
- + "interworking with the mechanisms required to orchestrate the nodes and containers on which "
- + "policies run. It is also responsible for the administration of policies at run time;"
- + " ensuring that policies are available to users, that policies are executing correctly,"
- + " and that the state and status of policies is monitored", version = "v1.0",
- title = "Policy Administration"),
- consumes = {MediaType.APPLICATION_JSON, PapRestControllerV1.APPLICATION_YAML},
- produces = {MediaType.APPLICATION_JSON, PapRestControllerV1.APPLICATION_YAML},
- schemes = {SwaggerDefinition.Scheme.HTTP, SwaggerDefinition.Scheme.HTTPS},
- tags = {@Tag(name = "policy-administration", description = "Policy Administration Service Operations")},
- securityDefinition = @SecurityDefinition(basicAuthDefinitions = {@BasicAuthDefinition(key = "basicAuth")}))
-// @formatter:on
+@RequestMapping
public class PapRestControllerV1 {
public static final String APPLICATION_YAML = "application/yaml";