summaryrefslogtreecommitdiffstats
path: root/rulemgt/src/main/java/org/onap/holmes/rulemgt/resources/SwaggerResource.java
diff options
context:
space:
mode:
authorGuangrong Fu <fu.guangrong@zte.com.cn>2021-12-28 10:14:42 +0800
committerGuangrong Fu <fu.guangrong@zte.com.cn>2022-08-11 20:18:53 +0800
commita796bda2f8e2db093ce9f528f6e5960e4aa1b22c (patch)
tree04642b9f3be109a5ccc051e4876851aa0b4fa3f3 /rulemgt/src/main/java/org/onap/holmes/rulemgt/resources/SwaggerResource.java
parent71ad58788ebfd666f6922fd9c16f77a9a4e39e27 (diff)
Migrate from DW to Springboot
Issue-ID: HOLMES-511 Signed-off-by: Guangrong Fu <fu.guangrong@zte.com.cn> Change-Id: I1be0775a4fc8b754218cd584a5de7af96b2ee0e2
Diffstat (limited to 'rulemgt/src/main/java/org/onap/holmes/rulemgt/resources/SwaggerResource.java')
-rw-r--r--rulemgt/src/main/java/org/onap/holmes/rulemgt/resources/SwaggerResource.java23
1 files changed, 10 insertions, 13 deletions
diff --git a/rulemgt/src/main/java/org/onap/holmes/rulemgt/resources/SwaggerResource.java b/rulemgt/src/main/java/org/onap/holmes/rulemgt/resources/SwaggerResource.java
index 83555b2..74996e5 100644
--- a/rulemgt/src/main/java/org/onap/holmes/rulemgt/resources/SwaggerResource.java
+++ b/rulemgt/src/main/java/org/onap/holmes/rulemgt/resources/SwaggerResource.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2017 ZTE Corporation.
+ * Copyright 2017-2022 ZTE Corporation.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -16,26 +16,23 @@
package org.onap.holmes.rulemgt.resources;
-import io.swagger.annotations.Api;
-import io.swagger.annotations.SwaggerDefinition;
+import jakarta.ws.rs.Produces;
+import jakarta.ws.rs.core.MediaType;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
import java.io.*;
import java.net.URL;
import java.net.URLDecoder;
-import javax.ws.rs.GET;
-import javax.ws.rs.Path;
-import javax.ws.rs.Produces;
-import javax.ws.rs.core.MediaType;
-import lombok.extern.slf4j.Slf4j;
-import org.jvnet.hk2.annotations.Service;
-@Service
-@Path("/swagger.json")
-@Produces(MediaType.APPLICATION_JSON)
+@RestController
+@RequestMapping("/swagger.json")
@Slf4j
public class SwaggerResource {
- @GET
+ @GetMapping
@Produces(MediaType.APPLICATION_JSON)
public String getSwaggerJson() {
URL url = SwaggerResource.class.getResource("/swagger.json");