aboutsummaryrefslogtreecommitdiffstats
path: root/cps-ncmp-rest
diff options
context:
space:
mode:
Diffstat (limited to 'cps-ncmp-rest')
-rw-r--r--cps-ncmp-rest/docs/openapi/components.yaml14
-rwxr-xr-xcps-ncmp-rest/docs/openapi/openapi-inventory.yml4
-rwxr-xr-xcps-ncmp-rest/docs/openapi/openapi.yml2
-rw-r--r--cps-ncmp-rest/pom.xml16
-rwxr-xr-xcps-ncmp-rest/src/main/java/org/onap/cps/ncmp/rest/controller/NetworkCmProxyController.java18
-rwxr-xr-xcps-ncmp-rest/src/main/java/org/onap/cps/ncmp/rest/exceptions/NetworkCmProxyRestExceptionHandler.java6
6 files changed, 31 insertions, 29 deletions
diff --git a/cps-ncmp-rest/docs/openapi/components.yaml b/cps-ncmp-rest/docs/openapi/components.yaml
index d45b8da288..818b2daeed 100644
--- a/cps-ncmp-rest/docs/openapi/components.yaml
+++ b/cps-ncmp-rest/docs/openapi/components.yaml
@@ -38,7 +38,7 @@ components:
properties:
message:
type: string
- example: "Bad Gateway Error Message NCMP"
+ example: 'Bad Gateway Error Message NCMP'
dmi-response:
type: object
properties:
@@ -160,11 +160,11 @@ components:
example: |
module stores {
yang-version 1.1;
- namespace "org:onap:ccsdk:sample";
+ namespace 'org:onap:ccsdk:sample';
prefix book-store;
- revision "2020-09-15" {
+ revision '2020-09-15' {
description
- "Sample Model";
+ 'Sample Model';
}
}
@@ -175,13 +175,11 @@ components:
cmHandleQueryParameters:
type: array
items:
- type: object
$ref: '#/components/schemas/ConditionProperties'
conditions:
deprecated: true
type: array
items:
- type: object
$ref: '#/components/schemas/OldConditionProperties'
description: not necessary, it is just for backward compatibility
@@ -203,7 +201,6 @@ components:
conditionParameters:
type: array
items:
- type: object
$ref: '#/components/schemas/ModuleNameAsJsonObject'
ModuleNameAsJsonObject:
properties:
@@ -293,7 +290,6 @@ components:
operations:
type: array
items:
- type: object
$ref: '#/components/schemas/DataOperationDefinition'
description: contains group of data operation requests
DataOperationDefinition:
@@ -321,7 +317,7 @@ components:
type: array
items:
type: string
- example: [ "da310eecdb8d44c2acc0ddaae01174b1","c748c58f8e0b438f9fd1f28370b17d47" ]
+ example: [ "da310eecdb8d44c2acc0ddaae01174b1","c748c58f8e0b438f9fd1f28370b17d47" ]
examples:
dataSampleRequest:
diff --git a/cps-ncmp-rest/docs/openapi/openapi-inventory.yml b/cps-ncmp-rest/docs/openapi/openapi-inventory.yml
index bd83dbf256..b794082875 100755
--- a/cps-ncmp-rest/docs/openapi/openapi-inventory.yml
+++ b/cps-ncmp-rest/docs/openapi/openapi-inventory.yml
@@ -1,6 +1,6 @@
# ============LICENSE_START=======================================================
# Copyright (C) 2021 Bell Canada
-# Modifications Copyright (C) 2022 Nordix Foundation
+# Modifications Copyright (C) 2022-2023 Nordix Foundation
# ================================================================================
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -17,7 +17,7 @@
# SPDX-License-Identifier: Apache-2.0
# ============LICENSE_END=========================================================
-openapi: 3.0.1
+openapi: 3.0.3
info:
title: NCMP Inventory API
description: NCMP Inventory API
diff --git a/cps-ncmp-rest/docs/openapi/openapi.yml b/cps-ncmp-rest/docs/openapi/openapi.yml
index 84d86fffbb..7ceb4fe70a 100755
--- a/cps-ncmp-rest/docs/openapi/openapi.yml
+++ b/cps-ncmp-rest/docs/openapi/openapi.yml
@@ -18,7 +18,7 @@
# SPDX-License-Identifier: Apache-2.0
# ============LICENSE_END=========================================================
-openapi: 3.0.1
+openapi: 3.0.3
info:
title: NCMP to CPS Proxy API
description: NCMP to CPS Proxy API
diff --git a/cps-ncmp-rest/pom.xml b/cps-ncmp-rest/pom.xml
index 8c84546b23..6679932dbd 100644
--- a/cps-ncmp-rest/pom.xml
+++ b/cps-ncmp-rest/pom.xml
@@ -116,8 +116,9 @@
<plugins>
<!-- Swagger code generation. -->
<plugin>
- <groupId>io.swagger.codegen.v3</groupId>
- <artifactId>swagger-codegen-maven-plugin</artifactId>
+ <groupId>org.openapitools</groupId>
+ <artifactId>openapi-generator-maven-plugin</artifactId>
+ <version>6.6.0</version>
<executions>
<execution>
<id>ncmp-code-gen</id>
@@ -129,13 +130,16 @@
<invokerPackage>org.onap.cps.ncmp.rest.controller</invokerPackage>
<modelPackage>org.onap.cps.ncmp.rest.model</modelPackage>
<apiPackage>org.onap.cps.ncmp.rest.api</apiPackage>
- <language>spring</language>
+ <generatorName>spring</generatorName>
<generateSupportingFiles>false</generateSupportingFiles>
+ <generateAliasAsModel>true</generateAliasAsModel>
<configOptions>
<sourceFolder>src/gen/java</sourceFolder>
<dateLibrary>java11</dateLibrary>
<interfaceOnly>true</interfaceOnly>
<useTags>true</useTags>
+ <openApiNullable>false</openApiNullable>
+ <skipDefaultInterface>true</skipDefaultInterface>
</configOptions>
</configuration>
</execution>
@@ -149,13 +153,15 @@
<invokerPackage>org.onap.cps.ncmp.rest.controller</invokerPackage>
<modelPackage>org.onap.cps.ncmp.rest.model</modelPackage>
<apiPackage>org.onap.cps.ncmp.rest.api</apiPackage>
- <language>spring</language>
+ <generatorName>spring</generatorName>
<generateSupportingFiles>false</generateSupportingFiles>
<configOptions>
<sourceFolder>src/gen/java</sourceFolder>
<dateLibrary>java11</dateLibrary>
<interfaceOnly>true</interfaceOnly>
<useTags>true</useTags>
+ <openApiNullable>false</openApiNullable>
+ <skipDefaultInterface>true</skipDefaultInterface>
</configOptions>
</configuration>
</execution>
@@ -167,7 +173,7 @@
<phase>compile</phase>
<configuration>
<inputSpec>${project.basedir}/docs/openapi/openapi-inventory.yml</inputSpec>
- <language>openapi-yaml</language>
+ <generatorName>openapi-yaml</generatorName>
<configOptions>
<outputFile>openapi-inventory.yaml</outputFile>
</configOptions>
diff --git a/cps-ncmp-rest/src/main/java/org/onap/cps/ncmp/rest/controller/NetworkCmProxyController.java b/cps-ncmp-rest/src/main/java/org/onap/cps/ncmp/rest/controller/NetworkCmProxyController.java
index 3c22b81ef7..b81378dd20 100755
--- a/cps-ncmp-rest/src/main/java/org/onap/cps/ncmp/rest/controller/NetworkCmProxyController.java
+++ b/cps-ncmp-rest/src/main/java/org/onap/cps/ncmp/rest/controller/NetworkCmProxyController.java
@@ -138,18 +138,18 @@ public class NetworkCmProxyController implements NetworkCmProxyApi {
/**
* Patch resource data from passthrough-running.
*
- * @param resourceIdentifier resource identifier
* @param datastoreName name of the datastore
* @param cmHandle cm handle identifier
+ * @param resourceIdentifier resource identifier
* @param requestBody the request body
* @param contentType content type of body
* @return {@code ResponseEntity} response from dmi plugin
*/
@Override
- public ResponseEntity<Object> patchResourceDataRunningForCmHandle(final String resourceIdentifier,
- final String datastoreName,
+ public ResponseEntity<Object> patchResourceDataRunningForCmHandle(final String datastoreName,
final String cmHandle,
+ final String resourceIdentifier,
final Object requestBody,
final String contentType) {
@@ -165,17 +165,17 @@ public class NetworkCmProxyController implements NetworkCmProxyApi {
/**
* Create resource data in datastore pass-through running for given cm-handle.
*
- * @param resourceIdentifier resource identifier
* @param datastoreName name of the datastore
* @param cmHandle cm handle identifier
+ * @param resourceIdentifier resource identifier
* @param requestBody the request body
* @param contentType content type of body
* @return {@code ResponseEntity} response from dmi plugin
*/
@Override
- public ResponseEntity<Void> createResourceDataRunningForCmHandle(final String resourceIdentifier,
- final String datastoreName,
+ public ResponseEntity<Void> createResourceDataRunningForCmHandle(final String datastoreName,
final String cmHandle,
+ final String resourceIdentifier,
final Object requestBody,
final String contentType) {
@@ -189,18 +189,18 @@ public class NetworkCmProxyController implements NetworkCmProxyApi {
/**
* Update resource data in datastore pass-through running for given cm-handle.
*
- * @param resourceIdentifier resource identifier
* @param datastoreName name of the datastore
* @param cmHandle cm handle identifier
+ * @param resourceIdentifier resource identifier
* @param requestBody the request body
* @param contentType content type of the body
* @return response entity
*/
@Override
- public ResponseEntity<Object> updateResourceDataRunningForCmHandle(final String resourceIdentifier,
- final String datastoreName,
+ public ResponseEntity<Object> updateResourceDataRunningForCmHandle(final String datastoreName,
final String cmHandle,
+ final String resourceIdentifier,
final Object requestBody,
final String contentType) {
validateDataStore(PASSTHROUGH_RUNNING, datastoreName);
diff --git a/cps-ncmp-rest/src/main/java/org/onap/cps/ncmp/rest/exceptions/NetworkCmProxyRestExceptionHandler.java b/cps-ncmp-rest/src/main/java/org/onap/cps/ncmp/rest/exceptions/NetworkCmProxyRestExceptionHandler.java
index f459acec25..fac9489127 100755
--- a/cps-ncmp-rest/src/main/java/org/onap/cps/ncmp/rest/exceptions/NetworkCmProxyRestExceptionHandler.java
+++ b/cps-ncmp-rest/src/main/java/org/onap/cps/ncmp/rest/exceptions/NetworkCmProxyRestExceptionHandler.java
@@ -1,7 +1,7 @@
/*
* ============LICENSE_START=======================================================
* Copyright (C) 2021 Pantheon.tech
- * Modifications Copyright (C) 2021-2022 Nordix Foundation
+ * Modifications Copyright (C) 2021-2023 Nordix Foundation
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -31,7 +31,7 @@ import org.onap.cps.ncmp.api.impl.exception.ServerNcmpException;
import org.onap.cps.ncmp.rest.controller.NetworkCmProxyController;
import org.onap.cps.ncmp.rest.controller.NetworkCmProxyInventoryController;
import org.onap.cps.ncmp.rest.model.DmiErrorMessage;
-import org.onap.cps.ncmp.rest.model.DmiErrorMessageDmiresponse;
+import org.onap.cps.ncmp.rest.model.DmiErrorMessageDmiResponse;
import org.onap.cps.ncmp.rest.model.ErrorMessage;
import org.onap.cps.spi.exceptions.AlreadyDefinedException;
import org.onap.cps.spi.exceptions.AlreadyDefinedExceptionBatch;
@@ -116,7 +116,7 @@ public class NetworkCmProxyRestExceptionHandler {
final HttpStatus httpStatus,
final HttpClientRequestException httpClientRequestException) {
final var dmiErrorMessage = new DmiErrorMessage();
- final var dmiErrorResponse = new DmiErrorMessageDmiresponse();
+ final var dmiErrorResponse = new DmiErrorMessageDmiResponse();
dmiErrorResponse.setHttpCode(httpClientRequestException.getHttpStatus());
dmiErrorResponse.setBody(httpClientRequestException.getDetails());
dmiErrorMessage.setMessage(httpClientRequestException.getMessage());