Adapt tests for OpenApi 04/108304/32
authorIvan Hrasko <ivan.hrasko@pantheon.tech>
Tue, 10 Oct 2023 13:41:24 +0000 (15:41 +0200)
committerIvan Hrasko <ivan.hrasko@pantheon.tech>
Fri, 8 Dec 2023 13:52:11 +0000 (13:52 +0000)
As intermediate step in adaptation from OpenApiObject record
removed all tests.

Edited AbstractDocumentTest class to save functionality.

JIRA: NETCONF-938
Change-Id: Ie64b28037652a7608f2129b19dd822400216e88e
Signed-off-by: Ivan Hrasko <ivan.hrasko@pantheon.tech>
Signed-off-by: lubos-cicut <lubos.cicut@pantheon.tech>
64 files changed:
restconf/restconf-openapi/src/main/java/org/opendaylight/restconf/openapi/impl/BaseYangOpenApiGenerator.java
restconf/restconf-openapi/src/test/java/org/opendaylight/restconf/openapi/DocGenTestHelper.java [deleted file]
restconf/restconf-openapi/src/test/java/org/opendaylight/restconf/openapi/JsonModelNameTest.java [deleted file]
restconf/restconf-openapi/src/test/java/org/opendaylight/restconf/openapi/OpenApiTestUtils.java [deleted file]
restconf/restconf-openapi/src/test/java/org/opendaylight/restconf/openapi/OperationalDataTest.java [deleted file]
restconf/restconf-openapi/src/test/java/org/opendaylight/restconf/openapi/SchemaObjectsTest.java [deleted file]
restconf/restconf-openapi/src/test/java/org/opendaylight/restconf/openapi/impl/AbstractDocumentTest.java
restconf/restconf-openapi/src/test/java/org/opendaylight/restconf/openapi/impl/DefinitionGeneratorTest.java [deleted file]
restconf/restconf-openapi/src/test/java/org/opendaylight/restconf/openapi/impl/KeysMappingTest.java [deleted file]
restconf/restconf-openapi/src/test/java/org/opendaylight/restconf/openapi/impl/ListPostRequestsTest.java [deleted file]
restconf/restconf-openapi/src/test/java/org/opendaylight/restconf/openapi/impl/OpenApiGeneratorRFC8040Test.java [deleted file]
restconf/restconf-openapi/src/test/java/org/opendaylight/restconf/openapi/impl/OpenApiServiceImplTest.java [deleted file]
restconf/restconf-openapi/src/test/java/org/opendaylight/restconf/openapi/impl/OpenApiXmlNamespaceTest.java [deleted file]
restconf/restconf-openapi/src/test/java/org/opendaylight/restconf/openapi/impl/PostPayloadTest.java [deleted file]
restconf/restconf-openapi/src/test/java/org/opendaylight/restconf/openapi/mountpoints/CustomOpenApiBasePathTest.java [deleted file]
restconf/restconf-openapi/src/test/java/org/opendaylight/restconf/openapi/mountpoints/MountPointOpenApiTest.java [deleted file]
restconf/restconf-openapi/src/test/resources/operational-document/controller-action-types.json
restconf/restconf-openapi/src/test/resources/operational-document/controller-all.json
restconf/restconf-openapi/src/test/resources/operational-document/controller-operational.json
restconf/restconf-openapi/src/test/resources/operational-document/device-action-types.json
restconf/restconf-openapi/src/test/resources/operational-document/device-all.json
restconf/restconf-openapi/src/test/resources/operational-document/device-operational.json
restconf/restconf-openapi/src/test/resources/sample-swagger-spec.json [deleted file]
restconf/restconf-openapi/src/test/resources/toaster-document/controller-all.json
restconf/restconf-openapi/src/test/resources/toaster-document/controller-toaster.json
restconf/restconf-openapi/src/test/resources/toaster-document/device-all.json
restconf/restconf-openapi/src/test/resources/toaster-document/device-toaster.json
restconf/restconf-openapi/src/test/resources/toaster.json [deleted file]
restconf/restconf-openapi/src/test/resources/topology-good.json [deleted file]
restconf/restconf-openapi/src/test/resources/topology-new.json [deleted file]
restconf/restconf-openapi/src/test/resources/topology.json [deleted file]
restconf/restconf-openapi/src/test/resources/wadl.xml [deleted file]
restconf/restconf-openapi/src/test/resources/yang-document/controller-action-types.json
restconf/restconf-openapi/src/test/resources/yang-document/controller-all.json
restconf/restconf-openapi/src/test/resources/yang-document/controller-choice-test.json
restconf/restconf-openapi/src/test/resources/yang-document/controller-definition-test.json
restconf/restconf-openapi/src/test/resources/yang-document/controller-mandatory-test.json
restconf/restconf-openapi/src/test/resources/yang-document/controller-my-yang.json
restconf/restconf-openapi/src/test/resources/yang-document/controller-opflex.json
restconf/restconf-openapi/src/test/resources/yang-document/controller-path-params-test.json
restconf/restconf-openapi/src/test/resources/yang-document/controller-recursive.json
restconf/restconf-openapi/src/test/resources/yang-document/controller-string-from-regex.json
restconf/restconf-openapi/src/test/resources/yang-document/controller-string-types.json
restconf/restconf-openapi/src/test/resources/yang-document/controller-test-container-childs.json
restconf/restconf-openapi/src/test/resources/yang-document/controller-toaster-augmented.json
restconf/restconf-openapi/src/test/resources/yang-document/controller-toaster.json
restconf/restconf-openapi/src/test/resources/yang-document/controller-toaster2.json
restconf/restconf-openapi/src/test/resources/yang-document/controller-typed-params.json
restconf/restconf-openapi/src/test/resources/yang-document/device-action-types.json
restconf/restconf-openapi/src/test/resources/yang-document/device-all.json
restconf/restconf-openapi/src/test/resources/yang-document/device-choice-test.json
restconf/restconf-openapi/src/test/resources/yang-document/device-definition-test.json
restconf/restconf-openapi/src/test/resources/yang-document/device-mandatory-test.json
restconf/restconf-openapi/src/test/resources/yang-document/device-my-yang.json
restconf/restconf-openapi/src/test/resources/yang-document/device-opflex.json
restconf/restconf-openapi/src/test/resources/yang-document/device-path-params-test.json
restconf/restconf-openapi/src/test/resources/yang-document/device-recursive.json
restconf/restconf-openapi/src/test/resources/yang-document/device-string-from-regex.json
restconf/restconf-openapi/src/test/resources/yang-document/device-string-types.json
restconf/restconf-openapi/src/test/resources/yang-document/device-test-container-childs.json
restconf/restconf-openapi/src/test/resources/yang-document/device-toaster-augmented.json
restconf/restconf-openapi/src/test/resources/yang-document/device-toaster.json
restconf/restconf-openapi/src/test/resources/yang-document/device-toaster2.json
restconf/restconf-openapi/src/test/resources/yang-document/device-typed-params.json

index f9ab42c6acfaa3cce6ac6eece7a77cec407f9f56..2f6648b4741aab614c8631f381dc3df91e525a70 100644 (file)
@@ -85,7 +85,7 @@ public abstract class BaseYangOpenApiGenerator {
     public static final String DESCRIPTION = """
         We are providing full API for configurational data which can be edited (by POST, PUT, PATCH and DELETE).
         For operational data we only provide GET API.\n
-        For majority of request you can see only config data in examples. Thats because we can show only one example
+        For majority of request you can see only config data in examples. That is because we can show only one example
         per request. The exception when you can see operational data in example is when data are representing
         operational (config false) container with no config data in it.""";
 
diff --git a/restconf/restconf-openapi/src/test/java/org/opendaylight/restconf/openapi/DocGenTestHelper.java b/restconf/restconf-openapi/src/test/java/org/opendaylight/restconf/openapi/DocGenTestHelper.java
deleted file mode 100644 (file)
index 0b91b09..0000000
+++ /dev/null
@@ -1,61 +0,0 @@
-/*
- * Copyright (c) 2014 Brocade Communications Systems, Inc. and others.  All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- */
-package org.opendaylight.restconf.openapi;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.mockito.ArgumentMatchers.any;
-import static org.mockito.Mockito.mock;
-import static org.mockito.Mockito.when;
-
-import java.net.URI;
-import java.util.Map;
-import javax.ws.rs.core.UriBuilder;
-import javax.ws.rs.core.UriInfo;
-import org.mockito.ArgumentCaptor;
-import org.opendaylight.restconf.openapi.model.Property;
-import org.opendaylight.restconf.openapi.model.Schema;
-
-public final class DocGenTestHelper {
-
-    private DocGenTestHelper() {
-        // hidden on purpose
-    }
-
-    public static UriInfo createMockUriInfo(final String urlPrefix) throws Exception {
-        final URI uri = new URI(urlPrefix);
-        final UriBuilder mockBuilder = mock(UriBuilder.class);
-
-        final ArgumentCaptor<String> subStringCapture = ArgumentCaptor.forClass(String.class);
-        when(mockBuilder.path(subStringCapture.capture())).thenReturn(mockBuilder);
-        when(mockBuilder.build()).then(invocation -> URI.create(uri + "/" + subStringCapture.getValue()));
-
-        final UriInfo info = mock(UriInfo.class);
-        when(info.getRequestUriBuilder()).thenReturn(mockBuilder);
-        when(mockBuilder.replaceQuery(any())).thenReturn(mockBuilder);
-        when(info.getBaseUri()).thenReturn(uri);
-
-        return info;
-    }
-
-    /**
-     * Checks whether object {@code mainObject} contains in properties/items key $ref with concrete value.
-     */
-    public static void containsReferences(final Schema mainObject, final String childObject,
-            final String expectedRef) {
-        final Map<String, Property> properties = mainObject.properties();
-        assertNotNull(properties);
-
-        final Property childNode = properties.get(childObject);
-        assertNotNull(childNode);
-
-        //list case
-        String refWrapper = childNode.items() == null ? childNode.ref() : childNode.items().ref();
-        assertEquals(expectedRef, refWrapper);
-    }
-}
diff --git a/restconf/restconf-openapi/src/test/java/org/opendaylight/restconf/openapi/JsonModelNameTest.java b/restconf/restconf-openapi/src/test/java/org/opendaylight/restconf/openapi/JsonModelNameTest.java
deleted file mode 100644 (file)
index d04eb4d..0000000
+++ /dev/null
@@ -1,99 +0,0 @@
-/*
- * Copyright (c) 2023 PANTHEON.tech, s.r.o. and others.  All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- */
-package org.opendaylight.restconf.openapi;
-
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertTrue;
-import static org.mockito.Mockito.mock;
-import static org.mockito.Mockito.when;
-
-import java.util.Arrays;
-import java.util.Optional;
-import javax.ws.rs.core.UriInfo;
-import org.junit.BeforeClass;
-import org.junit.Test;
-import org.opendaylight.mdsal.dom.api.DOMMountPoint;
-import org.opendaylight.mdsal.dom.api.DOMMountPointService;
-import org.opendaylight.mdsal.dom.api.DOMSchemaService;
-import org.opendaylight.restconf.openapi.impl.MountPointOpenApiGeneratorRFC8040;
-import org.opendaylight.restconf.openapi.model.OpenApiObject;
-import org.opendaylight.restconf.openapi.model.Operation;
-import org.opendaylight.yangtools.yang.common.QName;
-import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
-import org.opendaylight.yangtools.yang.test.util.YangParserTestUtils;
-
-public class JsonModelNameTest {
-    private static final String HTTP_URL = "http://localhost/path";
-    private static final YangInstanceIdentifier INSTANCE_ID = YangInstanceIdentifier.builder()
-        .node(QName.create("", "nodes"))
-        .node(QName.create("", "node"))
-        .nodeWithKey(QName.create("", "node"), QName.create("", "id"), "123").build();
-
-    private static OpenApiObject mountPointApi;
-
-    @BeforeClass
-    public static void beforeClass() throws Exception {
-        final var schemaService = mock(DOMSchemaService.class);
-        final var context = YangParserTestUtils.parseYangResourceDirectory("/yang");
-        when(schemaService.getGlobalContext()).thenReturn(context);
-        final UriInfo mockInfo = DocGenTestHelper.createMockUriInfo(HTTP_URL);
-        final DOMMountPointService service = mock(DOMMountPointService.class);
-        final DOMMountPoint mountPoint = mock(DOMMountPoint.class);
-        when(mountPoint.getService(DOMSchemaService.class)).thenReturn(Optional.of(schemaService));
-        when(service.getMountPoint(INSTANCE_ID)).thenReturn(Optional.of(mountPoint));
-        final var openApi = new MountPointOpenApiGeneratorRFC8040(schemaService, service).getMountPointOpenApi();
-        openApi.onMountPointCreated(INSTANCE_ID);
-
-        mountPointApi = openApi.getMountPointApi(mockInfo, 1L, null);
-        assertNotNull("Failed to find MountPoint API", mountPointApi);
-    }
-
-    @Test
-    public void testIfFirstNodeInJsonPayloadContainsCorrectModelName() {
-        for (final var stringPathEntry : mountPointApi.paths().entrySet()) {
-            final var put = stringPathEntry.getValue().put();
-            if (put != null) {
-                final var moduleName = getSchemaPutOperationModuleName(put);
-                assertNotNull("PUT module name for [" + put + "] is in wrong format", moduleName);
-                final var key = stringPathEntry.getKey();
-                final var expectedModuleName = extractModuleName(key);
-                assertTrue(moduleName.contains(expectedModuleName));
-            }
-        }
-    }
-
-    private static String getSchemaPutOperationModuleName(final Operation put) {
-        final var parentName  = put.requestBody().content().get("application/json").schema().properties()
-            .keySet().iterator().next();
-
-        final var doubleDotsIndex = parentName.indexOf(':');
-        if (doubleDotsIndex >= 0 && doubleDotsIndex < parentName.length() - 1) {
-            return parentName.substring(0, doubleDotsIndex + 1);
-        }
-        return null; // Return null if there is no string after the last "/"
-    }
-
-    /**
-     * Return last module name in provided path.
-     * <p>
-     * For example if path looks like this:
-     * `/rests/data/nodes/node=123/yang-ext:mount/mandatory-test:root-container/optional-list={id}/data2:data`
-     * then returned string should look like this: `data2`.
-     * </p>
-     * @param path String URI path
-     * @return last module name in URI
-     */
-    private static String extractModuleName(final String path) {
-        final var components = Arrays.stream(path.split("/"))
-            .filter(c -> c.contains(":"))
-            .toList();
-        assertFalse("No module name found in path: " + path, components.isEmpty());
-        return components.get(components.size() - 1).split(":")[0];
-    }
-}
diff --git a/restconf/restconf-openapi/src/test/java/org/opendaylight/restconf/openapi/OpenApiTestUtils.java b/restconf/restconf-openapi/src/test/java/org/opendaylight/restconf/openapi/OpenApiTestUtils.java
deleted file mode 100644 (file)
index 03b7fbb..0000000
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * Copyright (c) 2022 PANTHEON.tech, s.r.o. and others.  All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- */
-package org.opendaylight.restconf.openapi;
-
-import java.util.List;
-import java.util.Map;
-import org.opendaylight.restconf.openapi.model.Parameter;
-import org.opendaylight.restconf.openapi.model.Path;
-
-public final class OpenApiTestUtils {
-
-    private OpenApiTestUtils() {
-        // Hidden on purpose
-    }
-
-    /**
-     * Get path parameters names for {@code path} for GET operation.
-     *
-     * @return {@link List} of parameters excluding `content` parameter
-     */
-    public static List<String> getPathGetParameters(final Map<String, Path> paths, final String path) {
-        return paths.get(path).get().parameters()
-            .stream()
-            .map(Parameter::name)
-            .filter(p -> !"content".equals(p))
-            .toList();
-    }
-
-    /**
-     * Get path parameters names for {@code path} for POST operation.
-     *
-     * @return {@link List} of parameters
-     */
-    public static List<String> getPathPostParameters(final Map<String, Path> paths, final String path) {
-        return paths.get(path).post().parameters()
-            .stream()
-            .map(Parameter::name)
-            .toList();
-    }
-}
diff --git a/restconf/restconf-openapi/src/test/java/org/opendaylight/restconf/openapi/OperationalDataTest.java b/restconf/restconf-openapi/src/test/java/org/opendaylight/restconf/openapi/OperationalDataTest.java
deleted file mode 100644 (file)
index 8637083..0000000
+++ /dev/null
@@ -1,267 +0,0 @@
-/*
- * Copyright (c) 2023 PANTHEON.tech, s.r.o. and others.  All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- */
-package org.opendaylight.restconf.openapi;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertTrue;
-import static org.mockito.Mockito.mock;
-import static org.mockito.Mockito.when;
-
-import java.util.Map;
-import java.util.Optional;
-import java.util.Set;
-import org.junit.Before;
-import org.junit.Test;
-import org.opendaylight.mdsal.dom.api.DOMMountPoint;
-import org.opendaylight.mdsal.dom.api.DOMMountPointService;
-import org.opendaylight.mdsal.dom.api.DOMSchemaService;
-import org.opendaylight.restconf.openapi.impl.MountPointOpenApiGeneratorRFC8040;
-import org.opendaylight.restconf.openapi.model.OpenApiObject;
-import org.opendaylight.restconf.openapi.model.Schema;
-import org.opendaylight.yangtools.yang.common.QName;
-import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
-import org.opendaylight.yangtools.yang.test.util.YangParserTestUtils;
-
-public class OperationalDataTest {
-    private static final String DATA_MP_URI = "/rests/data/nodes/node=123/yang-ext:mount";
-    private static final String OPERATIONS_MP_URI = "/rests/operations/nodes/node=123/yang-ext:mount";
-    private static final Set<String> EXPECTED_SCHEMAS = Set.of(
-        "action-types_container",
-        "action-types_list",
-        "action-types_multi-container",
-        "action-types_container-action_input",
-        "action-types_container-action_output",
-        "action-types_list-action_output",
-        "action-types_list-action_input",
-        "action-types_multi-container_inner-container",
-        "operational_root",
-        "operational_root_config-container",
-        "operational_root_config-container_config-container-oper-list",
-        "operational_root_oper-container",
-        "operational_root_oper-container_config-container",
-        "operational_root_oper-container_oper-container-list");
-
-    private static final Set<String> EXPECTED_PATHS = Set.of(
-        OPERATIONS_MP_URI + "/action-types:list={name}/list-action",
-        OPERATIONS_MP_URI + "/action-types:container/container-action",
-        OPERATIONS_MP_URI + "/action-types:multi-container/inner-container/action",
-        OPERATIONS_MP_URI,
-        DATA_MP_URI + "/action-types:list={name}",
-        DATA_MP_URI + "/operational:root",
-        DATA_MP_URI + "/operational:root/oper-container/config-container",
-        DATA_MP_URI + "/operational:root/oper-container/oper-container-list={oper-container-list-leaf}",
-        DATA_MP_URI + "/action-types:multi-container",
-        DATA_MP_URI + "/action-types:multi-container/inner-container",
-        DATA_MP_URI + "/operational:root/oper-container",
-        DATA_MP_URI + "/action-types:container",
-        DATA_MP_URI + "/operational:root/config-container/config-container-oper-list={oper-container-list-leaf}",
-        DATA_MP_URI + "/operational:root/config-container",
-        DATA_MP_URI);
-    private static final String HTTP_URL = "http://localhost/path";
-    private static final YangInstanceIdentifier INSTANCE_ID = YangInstanceIdentifier.builder()
-        .node(QName.create("", "nodes"))
-        .node(QName.create("", "node"))
-        .nodeWithKey(QName.create("", "node"), QName.create("", "id"), "123").build();
-
-    private OpenApiObject mountPointApi;
-    private Map<String, Schema> schemas;
-
-    @Before
-    public void before() throws Exception {
-        final var schemaService = mock(DOMSchemaService.class);
-        final var context = YangParserTestUtils.parseYangResourceDirectory("/operational");
-        when(schemaService.getGlobalContext()).thenReturn(context);
-        final var mountPoint = mock(DOMMountPoint.class);
-        when(mountPoint.getService(DOMSchemaService.class)).thenReturn(Optional.of(schemaService));
-
-        final var service = mock(DOMMountPointService.class);
-        when(service.getMountPoint(INSTANCE_ID)).thenReturn(Optional.of(mountPoint));
-        final var openApi = new MountPointOpenApiGeneratorRFC8040(schemaService, service).getMountPointOpenApi();
-        openApi.onMountPointCreated(INSTANCE_ID);
-        final var mockInfo = DocGenTestHelper.createMockUriInfo(HTTP_URL);
-        mountPointApi = openApi.getMountPointApi(mockInfo, 1L, null);
-        assertNotNull("Failed to find Datastore API", mountPointApi);
-        schemas = mountPointApi.components().schemas();
-    }
-
-    @Test
-    public void testOperationalPath() {
-        final var paths = mountPointApi.paths();
-        assertEquals(EXPECTED_PATHS, paths.keySet());
-        for (final var path : paths.values()) {
-            if (path.get() != null) {
-                final var responses = path.get().responses();
-                final var response = responses.values().iterator().next();
-                final var content = response.content();
-                // In case of 200 no content
-                if (content != null) {
-                    verifyOperationHaveCorrectXmlReference(content.get("application/xml").schema());
-                    verifyOperationHaveCorrectJsonReference(content.get("application/json").schema());
-                }
-            }
-            if (path.put() != null) {
-                final var responses = path.put().requestBody();
-                final var content = responses.content();
-                verifyOperationHaveCorrectXmlReference(content.get("application/xml").schema());
-                verifyOperationHaveCorrectJsonReference(content.get("application/json").schema());
-            }
-            if (path.post() != null) {
-                final var responses = path.post().requestBody();
-                final var content = responses.content();
-                verifyOperationHaveCorrectXmlReference(content.get("application/xml").schema());
-                verifyOperationHaveCorrectJsonReference(content.get("application/json").schema());
-            }
-            if (path.patch() != null) {
-                final var responses = path.patch().requestBody();
-                final var content = responses.content();
-                verifyOperationHaveCorrectXmlReference(content.get("application/yang-data+xml").schema());
-                verifyOperationHaveCorrectJsonReference(content.get("application/yang-data+json").schema());
-            }
-        }
-    }
-
-    @Test
-    public void testOperationalSchema() {
-        assertEquals(EXPECTED_SCHEMAS, schemas.keySet());
-    }
-
-    @Test
-    public void testOperationalConfigRootSchemaProperties() {
-        final var configRoot = schemas.get("operational_root");
-        assertNotNull(configRoot);
-        final var actualProperties = configRoot.properties().keySet();
-        assertEquals(Set.of("leaf-config", "config-container"), actualProperties);
-    }
-
-    @Test
-    public void testOperationalConfigContOperListSchemaProperties() {
-        final var configContOperList = schemas.get(
-            "operational_root_config-container_config-container-oper-list");
-        assertNotNull(configContOperList);
-        final var actualProperties = configContOperList.properties().keySet();
-        assertEquals(Set.of("oper-container-list-leaf"), actualProperties);
-    }
-
-    @Test
-    public void testOperationalContListSchemaProperties() {
-        final var operContList = schemas.get("operational_root_oper-container_oper-container-list");
-        assertNotNull(operContList);
-        final var actualProperties = operContList.properties().keySet();
-        assertEquals(Set.of("oper-container-list-leaf"), actualProperties);
-    }
-
-    @Test
-    public void testOperationalConConfigContSchemaProperties() {
-        final var operConConfigCont = schemas.get("operational_root_oper-container_config-container");
-        assertNotNull(operConConfigCont);
-        final var actualProperties = operConConfigCont.properties().keySet();
-        assertEquals(Set.of("config-container-config-leaf", "opconfig-container-oper-leaf"), actualProperties);
-    }
-
-    @Test
-    public void testOperationalConfigContSchemaProperties() {
-        final var configCont = schemas.get("operational_root_config-container");
-        assertNotNull(configCont);
-        final var actualProperties = configCont.properties().keySet();
-        assertEquals(Set.of("config-container-config-leaf", "leaf-second-case"), actualProperties);
-    }
-
-    @Test
-    public void testOperationalContSchemaProperties() {
-        final var operCont = schemas.get("operational_root_oper-container");
-        assertNotNull(operCont);
-        final var actualProperties = operCont.properties().keySet();
-        assertEquals(Set.of("config-container", "oper-container-list", "leaf-first-case", "oper-leaf-first-case",
-            "oper-container-config-leaf-list"), actualProperties);
-    }
-
-    @Test
-    public void testListActionSchemaProperties() {
-        final var configRoot = schemas.get("action-types_list");
-        assertNotNull(configRoot);
-        final var actualProperties = configRoot.properties().keySet();
-        assertEquals(Set.of("name"), actualProperties);
-    }
-
-    @Test
-    public void testListActionInputSchemaProperties() {
-        final var configRoot = schemas.get("action-types_list-action_input");
-        assertNotNull(configRoot);
-        final var actualProperties = configRoot.properties().keySet();
-        assertEquals(Set.of("la-input"), actualProperties);
-    }
-
-    @Test
-    public void testListActionOutputSchemaProperties() {
-        final var configRoot = schemas.get("action-types_list-action_output");
-        assertNotNull(configRoot);
-        final var actualProperties = configRoot.properties().keySet();
-        assertEquals(Set.of("la-output"), actualProperties);
-    }
-
-    @Test
-    public void testContainerActionSchemaProperties() {
-        final var configRoot = schemas.get("action-types_container");
-        assertNotNull(configRoot);
-        final var actualProperties = configRoot.properties().keySet();
-        assertEquals(Set.of(), actualProperties);
-    }
-
-    @Test
-    public void testContainerActionInputSchemaProperties() {
-        final var configRoot = schemas.get("action-types_container-action_input");
-        assertNotNull(configRoot);
-        final var actualProperties = configRoot.properties().keySet();
-        assertEquals(Set.of("ca-input"), actualProperties);
-    }
-
-    @Test
-    public void testContainerActionOutputSchemaProperties() {
-        final var configRoot = schemas.get("action-types_container-action_output");
-        assertNotNull(configRoot);
-        final var actualProperties = configRoot.properties().keySet();
-        assertEquals(Set.of("ca-output"), actualProperties);
-    }
-
-    private static void verifyOperationHaveCorrectXmlReference(final Schema schema) {
-        final var refValue = schema.ref();
-        // In case of a POST RPC with a direct input body and no reference value
-        if (refValue != null) {
-            final var schemaElement = refValue.substring(refValue.lastIndexOf("/") + 1);
-            assertTrue("Reference [" + refValue + "] not found in EXPECTED Schemas",
-                EXPECTED_SCHEMAS.contains(schemaElement));
-        } else {
-            final var type = schema.type();
-            assertNotNull(type);
-            assertEquals("object", type);
-        }
-    }
-
-    private static void verifyOperationHaveCorrectJsonReference(final Schema schema) {
-        final var properties = schema.properties();
-        final String refValue;
-        if (properties != null) {
-            final var node = properties.values().iterator().next();
-            final var type = node.type();
-            if (type == null) {
-                refValue = node.ref();
-            } else if (type.equals("array")) {
-                refValue = node.items().ref();
-            } else {
-                assertEquals("object", type);
-                return;
-            }
-        } else {
-            refValue = schema.ref();
-        }
-        final var schemaElement = refValue.substring(refValue.lastIndexOf("/") + 1);
-        assertTrue("Reference [" + refValue + "] not found in EXPECTED Schemas",
-                EXPECTED_SCHEMAS.contains(schemaElement));
-    }
-}
diff --git a/restconf/restconf-openapi/src/test/java/org/opendaylight/restconf/openapi/SchemaObjectsTest.java b/restconf/restconf-openapi/src/test/java/org/opendaylight/restconf/openapi/SchemaObjectsTest.java
deleted file mode 100644 (file)
index 74782cf..0000000
+++ /dev/null
@@ -1,114 +0,0 @@
-/*
- * Copyright (c) 2023 PANTHEON.tech, s.r.o. and others.  All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- */
-package org.opendaylight.restconf.openapi;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.mockito.Mockito.mock;
-import static org.mockito.Mockito.when;
-
-import java.util.List;
-import java.util.Optional;
-import javax.ws.rs.core.UriInfo;
-import org.junit.BeforeClass;
-import org.junit.Test;
-import org.opendaylight.mdsal.dom.api.DOMMountPoint;
-import org.opendaylight.mdsal.dom.api.DOMMountPointService;
-import org.opendaylight.mdsal.dom.api.DOMSchemaService;
-import org.opendaylight.restconf.openapi.impl.MountPointOpenApiGeneratorRFC8040;
-import org.opendaylight.restconf.openapi.model.MediaTypeObject;
-import org.opendaylight.restconf.openapi.model.OpenApiObject;
-import org.opendaylight.restconf.openapi.model.Operation;
-import org.opendaylight.restconf.openapi.model.Schema;
-import org.opendaylight.yangtools.yang.common.QName;
-import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
-import org.opendaylight.yangtools.yang.test.util.YangParserTestUtils;
-
-public class SchemaObjectsTest {
-    private static final String HTTP_URL = "http://localhost/path";
-    private static final YangInstanceIdentifier INSTANCE_ID = YangInstanceIdentifier.builder()
-            .node(QName.create("", "nodes"))
-            .node(QName.create("", "node"))
-            .nodeWithKey(QName.create("", "node"), QName.create("" , "id"), "123").build();
-
-    private static OpenApiObject mountPointApi;
-
-    @BeforeClass
-    public static void beforeClass() throws Exception {
-        final var schemaService = mock(DOMSchemaService.class);
-        final var context = YangParserTestUtils.parseYangResourceDirectory("/yang");
-        when(schemaService.getGlobalContext()).thenReturn(context);
-        final UriInfo mockInfo = DocGenTestHelper.createMockUriInfo(HTTP_URL);
-        final DOMMountPointService service = mock(DOMMountPointService.class);
-        final DOMMountPoint mountPoint = mock(DOMMountPoint.class);
-        when(mountPoint.getService(DOMSchemaService.class)).thenReturn(Optional.of(schemaService));
-        when(service.getMountPoint(INSTANCE_ID)).thenReturn(Optional.of(mountPoint));
-        final var openApi = new MountPointOpenApiGeneratorRFC8040(schemaService, service).getMountPointOpenApi();
-        openApi.onMountPointCreated(INSTANCE_ID);
-
-        mountPointApi = openApi.getMountPointApi(mockInfo, 1L, null);
-        assertNotNull("Failed to find MountPoint API", mountPointApi);
-    }
-
-    @Test
-    public void testIfOperationsUseOneSchema() {
-        final var schemas = mountPointApi.components().schemas();
-        for (final var pathsEntry : mountPointApi.paths().entrySet()) {
-            final var path = pathsEntry.getValue();
-            if (path.post() == null || path.put() == null || path.patch() == null || path.delete() == null) {
-                // skip operational data
-                continue;
-            }
-            for (final var operation : List.of(path.put(), path.patch(), path.post())) {
-                final var schema = schemas.get(extractSchemaName(operation));
-                assertNotNull("Schema for \"" + operation + "\" is missing.", schema);
-            }
-        }
-    }
-
-    /**
-     * Extract schema name used for operation.
-     * <p>
-     * We assume that for all content types of operation (XML, JSON) the same schema is used. We extract its name from
-     * the schema reference used in operation.
-     * </p>
-     * @param operation for which we want to find schema
-     * @return name of the schema used for operation
-     */
-    private static String extractSchemaName(final Operation operation) {
-        // Find distinct schema refs
-        final var references = operation.requestBody().content().values().stream()
-            .map(MediaTypeObject::schema)
-            .map(SchemaObjectsTest::getRef)
-            .distinct()
-            .toList();
-        // Assert all schema refs are same
-        assertEquals("Inconsistent schemas for operation: " + operation.summary(), 1, references.size());
-        return references.get(0).replaceAll("#/components/schemas/", "");
-    }
-
-    private static String getRef(final Schema schema) {
-        final String ref;
-        if (schema.ref() != null) {
-            ref = schema.ref();
-        } else {
-            final var properties = schema.properties();
-            if (properties != null && !properties.isEmpty()) {
-                final var property = schema.properties().values().iterator().next();
-                if (property.type().equals("array")) {
-                    ref = property.items().ref();
-                } else {
-                    ref = property.ref();
-                }
-            } else {
-                ref = null;
-            }
-        }
-        return ref;
-    }
-}
index be25f6ff91583cffba50ea2eb7a710812d2c5ccb..3e64359eb4b015682dd7b0d75576b1fd55f6e950 100644 (file)
@@ -7,16 +7,20 @@
  */
 package org.opendaylight.restconf.openapi.impl;
 
+import static org.mockito.ArgumentMatchers.any;
 import static org.mockito.Mockito.mock;
 import static org.mockito.Mockito.when;
 
 import com.fasterxml.jackson.databind.ObjectMapper;
+import java.net.URI;
 import java.util.Optional;
+import javax.ws.rs.core.UriBuilder;
+import javax.ws.rs.core.UriInfo;
 import org.glassfish.jersey.internal.util.collection.ImmutableMultivaluedMap;
+import org.mockito.ArgumentCaptor;
 import org.opendaylight.mdsal.dom.api.DOMMountPoint;
 import org.opendaylight.mdsal.dom.api.DOMMountPointService;
 import org.opendaylight.mdsal.dom.api.DOMSchemaService;
-import org.opendaylight.restconf.openapi.DocGenTestHelper;
 import org.opendaylight.restconf.openapi.api.OpenApiService;
 import org.opendaylight.yangtools.yang.common.QName;
 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
@@ -61,7 +65,7 @@ public abstract class AbstractDocumentTest {
     }
 
     protected static String getAllModulesDoc() throws Exception {
-        final var getAllController = DocGenTestHelper.createMockUriInfo(URI + "single");
+        final var getAllController = createMockUriInfo(URI + "single");
         final var controllerDocAll = openApiService.getAllModulesDoc(getAllController).getEntity();
 
         return MAPPER.writeValueAsString(controllerDocAll);
@@ -72,7 +76,7 @@ public abstract class AbstractDocumentTest {
         if (revision != null) {
             uri = uri + "(" + revision + ")";
         }
-        final var getModuleController = DocGenTestHelper.createMockUriInfo(uri);
+        final var getModuleController = createMockUriInfo(uri);
         final var controllerDocModule = openApiService.getDocByModule(moduleName, revision, getModuleController);
 
         return MAPPER.writeValueAsString(controllerDocModule.getEntity());
@@ -80,7 +84,7 @@ public abstract class AbstractDocumentTest {
 
 
     protected static String getMountDoc() throws Exception {
-        final var getAllDevice = DocGenTestHelper.createMockUriInfo(URI + "mounts/1");
+        final var getAllDevice = createMockUriInfo(URI + "mounts/1");
         when(getAllDevice.getQueryParameters()).thenReturn(ImmutableMultivaluedMap.empty());
         final var deviceDocAll = openApiService.getMountDoc("1", getAllDevice);
 
@@ -89,9 +93,25 @@ public abstract class AbstractDocumentTest {
 
 
     protected static String getMountDocByModule(final String moduleName, final String revision) throws Exception {
-        final var getToasterDevice = DocGenTestHelper.createMockUriInfo(URI + "mounts/1/" + moduleName);
-        final var deviceDocToaster = openApiService.getMountDocByModule("1", moduleName, revision, getToasterDevice);
+        final var getDevice = createMockUriInfo(URI + "mounts/1/" + moduleName);
+        final var deviceDoc = openApiService.getMountDocByModule("1", moduleName, revision, getDevice);
 
-        return MAPPER.writeValueAsString(deviceDocToaster.getEntity());
+        return MAPPER.writeValueAsString(deviceDoc.getEntity());
+    }
+
+    public static UriInfo createMockUriInfo(final String urlPrefix) throws Exception {
+        final java.net.URI uri = new URI(urlPrefix);
+        final UriBuilder mockBuilder = mock(UriBuilder.class);
+
+        final ArgumentCaptor<String> subStringCapture = ArgumentCaptor.forClass(String.class);
+        when(mockBuilder.path(subStringCapture.capture())).thenReturn(mockBuilder);
+        when(mockBuilder.build()).then(invocation -> java.net.URI.create(uri + "/" + subStringCapture.getValue()));
+
+        final UriInfo info = mock(UriInfo.class);
+        when(info.getRequestUriBuilder()).thenReturn(mockBuilder);
+        when(mockBuilder.replaceQuery(any())).thenReturn(mockBuilder);
+        when(info.getBaseUri()).thenReturn(uri);
+
+        return info;
     }
 }
diff --git a/restconf/restconf-openapi/src/test/java/org/opendaylight/restconf/openapi/impl/DefinitionGeneratorTest.java b/restconf/restconf-openapi/src/test/java/org/opendaylight/restconf/openapi/impl/DefinitionGeneratorTest.java
deleted file mode 100644 (file)
index 3caa2ae..0000000
+++ /dev/null
@@ -1,310 +0,0 @@
-/*
- * Copyright (c) 2014, 2015 Cisco Systems, Inc. and others.  All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- */
-package org.opendaylight.restconf.openapi.impl;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertTrue;
-import static org.mockito.Mockito.mock;
-import static org.mockito.Mockito.when;
-
-import java.io.IOException;
-import java.math.BigDecimal;
-import java.util.ArrayList;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-import org.junit.BeforeClass;
-import org.junit.Test;
-import org.opendaylight.mdsal.dom.api.DOMSchemaService;
-import org.opendaylight.yangtools.yang.common.Revision;
-import org.opendaylight.yangtools.yang.model.api.EffectiveModelContext;
-import org.opendaylight.yangtools.yang.test.util.YangParserTestUtils;
-
-public final class DefinitionGeneratorTest {
-    private static EffectiveModelContext context;
-    private static DOMSchemaService schemaService;
-
-    @BeforeClass
-    public static void beforeClass() {
-        schemaService = mock(DOMSchemaService.class);
-        context = YangParserTestUtils.parseYangResourceDirectory("/yang");
-        when(schemaService.getGlobalContext()).thenReturn(context);
-    }
-
-    @Test
-    public void testConvertToSchemas() throws IOException {
-        final var module = context.findModule("opflex", Revision.of("2014-05-28")).orElseThrow();
-        final var schemas = DefinitionGenerator.convertToSchemas(module, context, new DefinitionNames(), true);
-        assertNotNull(schemas);
-    }
-
-    @Test
-    public void testActionTypes() throws IOException {
-        final var module = context.findModule("action-types").orElseThrow();
-        final var schemas = DefinitionGenerator.convertToSchemas(module, context, new DefinitionNames(), true);
-        assertNotNull(schemas);
-    }
-
-    @Test
-    public void testStringTypes() throws IOException {
-        final var module = context.findModule("string-types").orElseThrow();
-        final var schemas = DefinitionGenerator.convertToSchemas(module, context, new DefinitionNames(), true);
-        assertNotNull(schemas);
-    }
-
-    @Test
-    public void testEnumType() throws IOException {
-        final var module = context.findModule("definition-test").orElseThrow();
-        final var schemas = DefinitionGenerator.convertToSchemas(module, context, new DefinitionNames(), true);
-        assertNotNull(schemas);
-
-        final var properties = schemas.get("definition-test_enum-container").properties();
-        assertEquals("up", properties.get("status").defaultValue());
-    }
-
-    @Test
-    public void testUnionTypes() throws IOException {
-        final var module = context.findModule("definition-test").orElseThrow();
-        final var schemas = DefinitionGenerator.convertToSchemas(module, context, new DefinitionNames(), true);
-        assertNotNull(schemas);
-
-        final var properties = schemas.get("definition-test_union-container").properties();
-        assertEquals("5", properties.get("testUnion1").defaultValue());
-        assertEquals("integer", properties.get("testUnion1").type());
-        assertEquals(-2147483648, properties.get("testUnion1").example());
-        assertEquals("false", properties.get("testUnion2").defaultValue());
-        assertEquals("string", properties.get("testUnion2").type());
-        assertEquals("Some testUnion2", properties.get("testUnion2").example());
-        assertEquals("integer", properties.get("testUnion3").type());
-        assertEquals(-2147483648, properties.get("testUnion3").example());
-        assertEquals("false", properties.get("testUnion3").defaultValue());
-    }
-
-    @Test
-    public void testBinaryType() throws IOException {
-        final var module = context.findModule("definition-test").orElseThrow();
-        final var schemas = DefinitionGenerator.convertToSchemas(module, context, new DefinitionNames(), true);
-        assertNotNull(schemas);
-
-        final var properties = schemas.get("definition-test_binary-container").properties();
-        assertEquals("SGVsbG8gdGVzdCE=", properties.get("binary-data").defaultValue());
-    }
-
-    @Test
-    public void testBooleanType() throws IOException {
-        final var module = context.findModule("definition-test").orElseThrow();
-        final var schemas = DefinitionGenerator.convertToSchemas(module, context, new DefinitionNames(), true);
-        assertNotNull(schemas);
-
-        final var properties = schemas.get("definition-test_union-container").properties();
-        assertEquals(true, properties.get("testBoolean").defaultValue());
-        assertEquals(true, properties.get("testBoolean").example());
-    }
-
-    @Test
-    public void testNumberType() throws IOException {
-        final var module = context.findModule("definition-test").orElseThrow();
-        final var schemas = DefinitionGenerator.convertToSchemas(module, context, new DefinitionNames(), true);
-        assertNotNull(schemas);
-
-        final var properties = schemas.get("definition-test_number-container").properties();
-        assertEquals(42L, properties.get("testInteger").defaultValue());
-        assertEquals(42L, properties.get("testInt64").defaultValue());
-        assertEquals(BigDecimal.valueOf(42), properties.get("testUint64").defaultValue());
-        assertEquals(100L, properties.get("testUnsignedInteger").defaultValue());
-        assertEquals(BigDecimal.valueOf(3.14), properties.get("testDecimal").defaultValue());
-        assertEquals(BigDecimal.valueOf(3.14159265359), properties.get("testDouble").defaultValue());
-    }
-
-    @Test
-    public void testInstanceIdentifierType() throws IOException {
-        final var module = context.findModule("definition-test").orElseThrow();
-        final var schemas = DefinitionGenerator.convertToSchemas(module, context, new DefinitionNames(), true);
-        assertNotNull(schemas);
-
-        final var properties = schemas.get("definition-test_network-container").properties();
-        final var networkRef = properties.get("network-ref");
-
-        assertNotNull(networkRef);
-        assertEquals("string", networkRef.type());
-
-        assertEquals("/network/nodes[node-id='node1']", networkRef.defaultValue());
-        assertEquals("/sample:binary-container", networkRef.example());
-    }
-
-    @Test
-    public void testStringFromRegex() throws IOException {
-        final var module = context.findModule("strings-from-regex").orElseThrow();
-        final var jsonObject = DefinitionGenerator.convertToSchemas(module, context, new DefinitionNames(), true);
-        assertNotNull(jsonObject);
-
-        final var properties = jsonObject.get("strings-from-regex_test").properties();
-        assertEquals("00:00:00:00:00:00", properties.get("mac-address").example().toString());
-        assertEquals("0000-00-00T00:00:00Z", properties.get("login-date-time").example().toString());
-        assertEquals("0.0.0.0", properties.get("ipv4-address").example().toString());
-    }
-
-    /**
-     * Test that checks if namespace for rpc is present.
-     */
-    @Test
-    public void testRpcNamespace() throws Exception {
-        final var module = context.findModule("toaster", Revision.of("2009-11-20")).orElseThrow();
-        final var jsonObject = DefinitionGenerator.convertToSchemas(module, context, new DefinitionNames(), true);
-        assertNotNull(jsonObject);
-        final var schema = jsonObject.get("toaster_make-toast_input");
-        assertNotNull(schema);
-        final var xml = schema.xml();
-        assertNotNull(xml);
-        final var namespace = xml.namespace();
-        assertNotNull(namespace);
-        assertEquals("http://netconfcentral.org/ns/toaster", namespace);
-    }
-
-    /**
-     * Test that checks if namespace for actions is present.
-     */
-    @Test
-    public void testActionsNamespace() throws IOException {
-        final var module = context.findModule("action-types").orElseThrow();
-        final var jsonObject = DefinitionGenerator.convertToSchemas(module, context, new DefinitionNames(), true);
-        assertNotNull(jsonObject);
-        final var schema = jsonObject.get("action-types_container-action_input");
-        assertNotNull(schema);
-        final var xml = schema.xml();
-        assertNotNull(xml);
-        final var namespace = xml.namespace();
-        assertNotNull(namespace);
-        assertEquals("urn:ietf:params:xml:ns:yang:test:action:types", namespace);
-    }
-
-    /**
-     *  This test is designed to verify if yang Identity is used correctly as string value
-     *  and no extra schemas are generated.
-     */
-    @Test
-    public void testIdentity() throws IOException {
-        final var module = context.findModule("toaster", Revision.of("2009-11-20")).orElseThrow();
-        final var schemas = DefinitionGenerator.convertToSchemas(module, context, new DefinitionNames(), true);
-        assertNotNull(schemas);
-
-        // correct number of schemas generated
-        assertEquals(2, schemas.size());
-        final var makeToast = schemas.get("toaster_make-toast_input").properties().get("toasterToastType");
-
-        assertEquals("wheat-bread", makeToast.defaultValue().toString());
-        assertEquals("toast-type", makeToast.example().toString());
-        assertEquals("string", makeToast.type());
-        assertEquals("""
-                This variable informs the toaster of the type of
-                      material that is being toasted. The toaster
-                      uses this information, combined with
-                      toasterDoneness, to compute for how
-                      long the material must be toasted to achieve
-                      the required doneness.""", makeToast.description());
-        assertTrue(makeToast.enums().containsAll(Set.of("toast-type","white-bread", "wheat-bread", "frozen-waffle",
-            "hash-brown", "frozen-bagel", "wonder-bread")));
-    }
-
-    /**
-     * Test that checks if list min-elements and max-elements are present.
-     * Also checks if number of example elements meets the min-elements condition
-     */
-    @Test
-    public void testListExamples() throws IOException {
-        final var module = context.findModule("test-container-childs", Revision.of("2023-09-28")).orElseThrow();
-        final var jsonObject = DefinitionGenerator.convertToSchemas(module, context, new DefinitionNames(), true);
-        final var component = jsonObject.get("test-container-childs_root-container_nested-container");
-        assertNotNull(component);
-        assertNotNull(component.properties());
-        final var property = component.properties().get("mandatory-list");
-        assertNotNull(property);
-        assertNotNull(property.minItems());
-        assertNotNull(property.maxItems());
-        assertEquals(3, (int) property.minItems());
-        assertEquals(5, (int) property.maxItems());
-        final var example = property.example();
-        assertNotNull(example);
-        assertEquals(ArrayList.class, example.getClass());
-        assertEquals(3, ((List<?>)example).size());
-    }
-
-    /**
-     * Test that checks if list min-elements and max-elements are present.
-     * Also checks if number of example elements meets the min-elements condition
-     * and if key defined leaf have unique values.
-     */
-    @Test
-    public void testListExamplesWithNonKeyLeaf() throws IOException {
-        final var module = context.findModule("test-container-childs", Revision.of("2023-09-28")).orElseThrow();
-        final var jsonObject = DefinitionGenerator.convertToSchemas(module, context, new DefinitionNames(), true);
-        final var component = jsonObject.get("test-container-childs_root-container_nested-container");
-        assertNotNull(component);
-        assertNotNull(component.properties());
-        final var property = component.properties().get("mandatory-list");
-        assertNotNull(property);
-        assertNotNull(property.minItems());
-        assertNotNull(property.maxItems());
-        assertEquals(3, (int) property.minItems());
-        assertEquals(5, (int) property.maxItems());
-        final var example = property.example();
-        assertNotNull(example);
-        assertEquals(3, ((List<?>)example).size());
-        assertTrue(checkUniqueExample(example, "id"));
-    }
-
-    /**
-     * Test that checks if multiple key leafs have unique values.
-     * Also checks if nested container node is ignored.
-     */
-    @Test
-    public void testListExamplesWithTwoKeys() throws IOException {
-        final var module = context.findModule("test-container-childs", Revision.of("2023-09-28")).orElseThrow();
-        final var jsonObject = DefinitionGenerator.convertToSchemas(module, context, new DefinitionNames(), true);
-        final var component = jsonObject.get("test-container-childs_root-container-two-keys_nested-container-two-keys");
-        assertNotNull(component);
-        assertNotNull(component.properties());
-        final var property = component.properties().get("mandatory-list-two-keys");
-        assertNotNull(property);
-        final var example = property.example();
-        assertNotNull(example);
-        assertTrue(checkUniqueExample(example, "id"));
-        assertTrue(checkUniqueExample(example, "name"));
-        assertEquals(3, ((ArrayList<Map<?,?>>)example).get(0).size());
-    }
-
-    /**
-     * Test that checks if sets of unique defined leafs have unique combination of values.
-     */
-    @Test
-    public void testListExamplesWithUnique() throws IOException {
-        final var module = context.findModule("test-container-childs", Revision.of("2023-09-28")).orElseThrow();
-        final var jsonObject = DefinitionGenerator.convertToSchemas(module, context, new DefinitionNames(), true);
-        final var component = jsonObject.get("test-container-childs_root-container-unique_nested-container-unique");
-        assertNotNull(component);
-        assertNotNull(component.properties());
-        final var property = component.properties().get("mandatory-list-unique");
-        assertNotNull(property);
-        final var example = property.example();
-        assertNotNull(example);
-        assertTrue(checkUniqueExample(example, "id"));
-        assertTrue(checkUniqueExample(example, "name") || checkUniqueExample(example, "address"));
-    }
-
-    private static boolean checkUniqueExample(final Object examples, final String key) {
-        assertEquals(ArrayList.class, examples.getClass());
-        final var exampleValues = new HashSet<>();
-
-        for (final Map<String, Object> example : (ArrayList<Map<String, Object>>)examples) {
-            exampleValues.add(example.get(key));
-        }
-        return (exampleValues.size() == ((ArrayList<?>) examples).size());
-    }
-}
diff --git a/restconf/restconf-openapi/src/test/java/org/opendaylight/restconf/openapi/impl/KeysMappingTest.java b/restconf/restconf-openapi/src/test/java/org/opendaylight/restconf/openapi/impl/KeysMappingTest.java
deleted file mode 100644 (file)
index 90c5c14..0000000
+++ /dev/null
@@ -1,91 +0,0 @@
-/*
- * Copyright (c) 2023 PANTHEON.tech, s.r.o. and others.  All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- */
-package org.opendaylight.restconf.openapi.impl;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertTrue;
-import static org.mockito.Mockito.mock;
-import static org.mockito.Mockito.when;
-import static org.opendaylight.restconf.openapi.OpenApiTestUtils.getPathGetParameters;
-
-import java.util.List;
-import org.junit.BeforeClass;
-import org.junit.Test;
-import org.opendaylight.mdsal.dom.api.DOMSchemaService;
-import org.opendaylight.restconf.openapi.DocGenTestHelper;
-import org.opendaylight.restconf.openapi.model.OpenApiObject;
-import org.opendaylight.yangtools.yang.test.util.YangParserTestUtils;
-
-public class KeysMappingTest {
-    private static OpenApiObject doc;
-
-    @BeforeClass
-    public static void startUp() throws Exception {
-        final var context = YangParserTestUtils.parseYang("""
-            module keys-mapping {
-              namespace "mapping";
-              prefix keys-mapping;
-                list multiple-key-list {
-                  key "name name2";
-                  leaf name {
-                    type string;
-                  }
-                  leaf name2 {
-                    type string;
-                  }
-                  list multiple-key-list2 {
-                    key "name name3";
-                    leaf name {
-                      type string;
-                    }
-                    leaf name3 {
-                      type string;
-                    }
-                    list multiple-key-list3 {
-                      key "name3 name";
-                      leaf name3 {
-                        type string;
-                      }
-                      leaf name {
-                        type string;
-                      }
-                      list multiple-key-list4 {
-                        key name;
-                        leaf name {
-                          type string;
-                        }
-                      }
-                    }
-                  }
-                }
-              }""");
-        final var schemaService = mock(DOMSchemaService.class);
-        when(schemaService.getGlobalContext()).thenReturn(context);
-        final var generator = new OpenApiGeneratorRFC8040(schemaService);
-        final var uriInfo = DocGenTestHelper.createMockUriInfo("http://localhost/path");
-        doc = generator.getApiDeclaration("keys-mapping", null, uriInfo);
-        assertNotNull(doc);
-    }
-
-    /**
-     * This test is designed to verify if the request parameters for nested lists with multiple keys are being
-     * enumerated properly.
-     *
-     * <p>
-     * This would mean that we will have name, name1, etc., when the same parameter appears multiple times in the path.
-     */
-    @Test
-    public void testKeysMapping() {
-        final var pathToMultipleKeyList4 = "/rests/data/keys-mapping:multiple-key-list={name},{name2}"
-            + "/multiple-key-list2={name1},{name3}/multiple-key-list3={name31},{name4}/multiple-key-list4={name5}";
-        assertTrue(doc.paths().containsKey(pathToMultipleKeyList4));
-        assertEquals(List.of("name","name2", "name1", "name3", "name31", "name4", "name5"),
-            getPathGetParameters(doc.paths(), pathToMultipleKeyList4));
-    }
-}
diff --git a/restconf/restconf-openapi/src/test/java/org/opendaylight/restconf/openapi/impl/ListPostRequestsTest.java b/restconf/restconf-openapi/src/test/java/org/opendaylight/restconf/openapi/impl/ListPostRequestsTest.java
deleted file mode 100644 (file)
index 75dfe90..0000000
+++ /dev/null
@@ -1,76 +0,0 @@
-/*
- * Copyright (c) 2023 PANTHEON.tech, s.r.o. and others.  All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- */
-package org.opendaylight.restconf.openapi.impl;
-
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertNull;
-import static org.mockito.Mockito.mock;
-import static org.mockito.Mockito.when;
-
-import org.junit.BeforeClass;
-import org.junit.Test;
-import org.opendaylight.mdsal.dom.api.DOMSchemaService;
-import org.opendaylight.restconf.openapi.DocGenTestHelper;
-import org.opendaylight.restconf.openapi.model.OpenApiObject;
-import org.opendaylight.yangtools.yang.test.util.YangParserTestUtils;
-
-public class ListPostRequestsTest {
-    private static OpenApiObject doc;
-
-    @BeforeClass
-    public static void startUp() throws Exception {
-        final var context = YangParserTestUtils.parseYang("""
-            module list-post {
-              namespace "list-post";
-              prefix lp;
-                container container {
-                  list list {
-                    key "name address";
-                    leaf name {
-                      type string;
-                    }
-                    leaf address {
-                      type string;
-                    }
-                  }
-                }
-              }""");
-        final var schemaService = mock(DOMSchemaService.class);
-        when(schemaService.getGlobalContext()).thenReturn(context);
-        final var generator = new OpenApiGeneratorRFC8040(schemaService);
-        final var uriInfo = DocGenTestHelper.createMockUriInfo("http://localhost/path");
-        doc = generator.getApiDeclaration("list-post", null, uriInfo);
-        assertNotNull(doc);
-    }
-
-    /**
-     * Test to verify that we do NOT generate OpenApi example POST request for path ending with list element.
-     *
-     * <p>
-     * Assert that for paths ending with container we have examples for all types of requests.
-     * Assert that for paths ending with list we do NOT have POST example.
-     */
-    @Test
-    public void testListPostRequest() {
-        // for container, we have both post (with child as payload) and put (with itself as payload)
-        final var pathToContainer = "/rests/data/list-post:container";
-        assertNotNull(doc.paths().get(pathToContainer).get());
-        assertNotNull(doc.paths().get(pathToContainer).post());
-        assertNotNull(doc.paths().get(pathToContainer).put());
-        assertNotNull(doc.paths().get(pathToContainer).patch());
-        assertNotNull(doc.paths().get(pathToContainer).delete());
-
-        // for list, we cannot make a post request
-        final var pathToList = "/rests/data/list-post:container/list={name},{address}";
-        assertNotNull(doc.paths().get(pathToList).get());
-        assertNull(doc.paths().get(pathToList).post());
-        assertNotNull(doc.paths().get(pathToList).put());
-        assertNotNull(doc.paths().get(pathToList).patch());
-        assertNotNull(doc.paths().get(pathToList).delete());
-    }
-}
diff --git a/restconf/restconf-openapi/src/test/java/org/opendaylight/restconf/openapi/impl/OpenApiGeneratorRFC8040Test.java b/restconf/restconf-openapi/src/test/java/org/opendaylight/restconf/openapi/impl/OpenApiGeneratorRFC8040Test.java
deleted file mode 100644 (file)
index 711dc48..0000000
+++ /dev/null
@@ -1,658 +0,0 @@
-/*
- * Copyright (c) 2021 PANTHEON.tech, s.r.o. and others.  All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- */
-package org.opendaylight.restconf.openapi.impl;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertNull;
-import static org.junit.Assert.assertTrue;
-import static org.mockito.Mockito.mock;
-import static org.mockito.Mockito.when;
-import static org.opendaylight.restconf.openapi.OpenApiTestUtils.getPathGetParameters;
-import static org.opendaylight.restconf.openapi.OpenApiTestUtils.getPathPostParameters;
-import static org.opendaylight.restconf.openapi.impl.BaseYangOpenApiGenerator.BASIC_AUTH_NAME;
-import static org.opendaylight.restconf.openapi.model.builder.OperationBuilder.COMPONENTS_PREFIX;
-
-import java.util.ArrayList;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-import javax.ws.rs.core.UriInfo;
-import org.junit.BeforeClass;
-import org.junit.Test;
-import org.opendaylight.mdsal.dom.api.DOMSchemaService;
-import org.opendaylight.restconf.openapi.DocGenTestHelper;
-import org.opendaylight.restconf.openapi.model.MediaTypeObject;
-import org.opendaylight.restconf.openapi.model.OpenApiObject;
-import org.opendaylight.restconf.openapi.model.Operation;
-import org.opendaylight.restconf.openapi.model.Path;
-import org.opendaylight.restconf.openapi.model.Property;
-import org.opendaylight.restconf.openapi.model.Schema;
-import org.opendaylight.yangtools.yang.model.api.EffectiveModelContext;
-import org.opendaylight.yangtools.yang.test.util.YangParserTestUtils;
-
-public final class OpenApiGeneratorRFC8040Test {
-    private static final String TOASTER_2 = "toaster2";
-    private static final String REVISION_DATE = "2009-11-20";
-    private static final String MANDATORY_TEST = "mandatory-test";
-    private static final String CONFIG_ROOT_CONTAINER = "mandatory-test_root-container";
-    private static final String CONFIG_MANDATORY_CONTAINER = "mandatory-test_root-container_mandatory-container";
-    private static final String CONFIG_MANDATORY_LIST = "mandatory-test_root-container_mandatory-list";
-    private static final String CONTAINER = "container";
-    private static final String LIST = "list";
-
-    private static DOMSchemaService schemaService;
-    private static UriInfo uriInfo;
-
-    private final OpenApiGeneratorRFC8040 generator = new OpenApiGeneratorRFC8040(schemaService);
-
-    @BeforeClass
-    public static void beforeClass() throws Exception {
-        schemaService = mock(DOMSchemaService.class);
-        final EffectiveModelContext context = YangParserTestUtils.parseYangResourceDirectory("/yang");
-        when(schemaService.getGlobalContext()).thenReturn(context);
-        uriInfo = DocGenTestHelper.createMockUriInfo("http://localhost/path");
-    }
-
-    /**
-     * Test that paths are generated according to the model.
-     */
-    @Test
-    public void testPaths() {
-        final OpenApiObject doc = generator.getApiDeclaration(TOASTER_2, REVISION_DATE, uriInfo);
-
-        assertEquals(Set.of("/rests/data",
-            "/rests/data/toaster2:toaster",
-            "/rests/data/toaster2:toaster/toasterSlot={slotId}",
-            "/rests/data/toaster2:toaster/toasterSlot={slotId}/toaster-augmented:slotInfo",
-            "/rests/data/toaster2:lst={lf1}",
-            "/rests/data/toaster2:lst={lf1}/cont1",
-            "/rests/data/toaster2:lst={lf1}/cont1/cont11",
-            "/rests/data/toaster2:lst={lf1}/cont1/lst11={lf111}",
-            "/rests/data/toaster2:lst={lf1}/lst1={key1},{key2}",
-            "/rests/operations/toaster2:make-toast",
-            "/rests/operations/toaster2:cancel-toast",
-            "/rests/operations/toaster2:restock-toaster"),
-            doc.paths().keySet());
-    }
-
-    /**
-     * Test that generated configuration paths allow to use operations: get, put, patch, delete and post.
-     */
-    @Test
-    public void testConfigPaths() {
-        final List<String> configPaths = List.of("/rests/data/toaster2:lst={lf1}",
-                "/rests/data/toaster2:lst={lf1}/cont1",
-                "/rests/data/toaster2:lst={lf1}/cont1/cont11",
-                "/rests/data/toaster2:lst={lf1}/cont1/lst11={lf111}",
-                "/rests/data/toaster2:lst={lf1}/lst1={key1},{key2}");
-        final String configPathForPostCont = "/rests/data/toaster2:lst={lf1}/cont1";
-        final String configPathForPostLeaf = "/rests/data/toaster2:lst={lf1}/cont1/cont11";
-
-        final OpenApiObject doc = generator.getApiDeclaration(TOASTER_2, REVISION_DATE, uriInfo);
-
-        for (final String path : configPaths) {
-            final Path node = doc.paths().get(path);
-            assertNotNull(node.get());
-            assertNotNull(node.put());
-            assertNotNull(node.delete());
-            assertNotNull(node.patch());
-        }
-
-        final Path node = doc.paths().get(configPathForPostCont);
-        assertNotNull(node.post());
-
-        // Assert we do not generate post for container which contains only leafs.
-        final Path nodeLeaf = doc.paths().get(configPathForPostLeaf);
-        assertNull(nodeLeaf.post());
-    }
-
-    /**
-     * Test that generated document contains the following schemas.
-     */
-    @Test
-    public void testSchemas() {
-        final OpenApiObject doc = generator.getApiDeclaration(TOASTER_2, REVISION_DATE, uriInfo);
-
-        final Map<String, Schema> schemas = doc.components().schemas();
-        assertNotNull(schemas);
-
-        final Schema configLst = schemas.get("toaster2_lst");
-        assertNotNull(configLst);
-        DocGenTestHelper.containsReferences(configLst, "lst1", "#/components/schemas/toaster2_lst_lst1");
-        DocGenTestHelper.containsReferences(configLst, "cont1", "#/components/schemas/toaster2_lst_cont1");
-
-        final Schema configLst1 = schemas.get("toaster2_lst_lst1");
-        assertNotNull(configLst1);
-
-        final Schema configCont1 = schemas.get("toaster2_lst_cont1");
-        assertNotNull(configCont1);
-        DocGenTestHelper.containsReferences(configCont1, "cont11", "#/components/schemas/toaster2_lst_cont1_cont11");
-        DocGenTestHelper.containsReferences(configCont1, "lst11", "#/components/schemas/toaster2_lst_cont1_lst11");
-
-        final Schema configCont11 = schemas.get("toaster2_lst_cont1_cont11");
-        assertNotNull(configCont11);
-
-        final Schema configLst11 = schemas.get("toaster2_lst_cont1_lst11");
-        assertNotNull(configLst11);
-    }
-
-    /**
-     * Test that reference to schema in each path is valid (all referenced schemas exist).
-     */
-    @Test
-    public void testSchemasExistenceSingleModule() {
-        final var document = generator.getApiDeclaration(TOASTER_2, REVISION_DATE, uriInfo);
-        assertNotNull(document);
-        final var referencedSchemas = new HashSet<String>();
-        for (final var path : document.paths().values()) {
-            referencedSchemas.addAll(extractSchemaRefFromPath(path));
-        }
-        final var schemaNames = document.components().schemas().keySet();
-        for (final var ref : referencedSchemas) {
-            assertTrue("Referenced schema " + ref + " does not exist", schemaNames.contains(ref));
-        }
-    }
-
-    /**
-     * Test that generated document contains RPC schemas for "make-toast" with correct input.
-     */
-    @Test
-    public void testRPC() {
-        final OpenApiObject doc = generator.getApiDeclaration("toaster", "2009-11-20", uriInfo);
-        assertNotNull(doc);
-
-        final Map<String, Schema> schemas = doc.components().schemas();
-        final Schema input = schemas.get("toaster_make-toast_input");
-        final Map<String, Property> properties = input.properties();
-        assertTrue(properties.containsKey("toasterDoneness"));
-        assertTrue(properties.containsKey("toasterToastType"));
-    }
-
-    @Test
-    public void testChoice() {
-        final var doc = generator.getApiDeclaration("choice-test", null, uriInfo);
-        assertNotNull(doc);
-
-        final var schemas = doc.components().schemas();
-        final var firstContainer = schemas.get("choice-test_first-container");
-        assertEquals("default-value", firstContainer.properties().get("leaf-default").defaultValue().toString());
-        assertFalse(firstContainer.properties().containsKey("leaf-non-default"));
-
-        final var secondContainer = schemas.get("choice-test_second-container");
-        assertTrue(secondContainer.properties().containsKey("leaf-first-case"));
-        assertFalse(secondContainer.properties().containsKey("leaf-second-case"));
-    }
-
-    @Test
-    public void testMandatory() {
-        final var doc = generator.getApiDeclaration(MANDATORY_TEST, null, uriInfo);
-        assertNotNull(doc);
-        final var schemas = doc.components().schemas();
-        final var containersWithRequired = new ArrayList<String>();
-
-        final var reqRootContainerElements = List.of("mandatory-root-leaf", "mandatory-container",
-            "mandatory-first-choice", "mandatory-list");
-        verifyRequiredField(schemas.get(CONFIG_ROOT_CONTAINER), reqRootContainerElements);
-        containersWithRequired.add(CONFIG_ROOT_CONTAINER);
-
-        final var reqMandatoryContainerElements = List.of("mandatory-leaf", "leaf-list-with-min-elements");
-        verifyRequiredField(schemas.get(CONFIG_MANDATORY_CONTAINER), reqMandatoryContainerElements);
-        containersWithRequired.add(CONFIG_MANDATORY_CONTAINER);
-
-        final var reqMandatoryListElements = List.of("mandatory-list-field");
-        verifyRequiredField(schemas.get(CONFIG_MANDATORY_LIST), reqMandatoryListElements);
-        containersWithRequired.add(CONFIG_MANDATORY_LIST);
-
-        verifyThatOthersNodeDoesNotHaveRequiredField(containersWithRequired, schemas);
-    }
-
-    /**
-     * Test that checks for correct amount of parameters in requests.
-     */
-    @Test
-    public void testRecursiveParameters() {
-        final var configPaths = Map.of("/rests/data/recursive:container-root", 0,
-            "/rests/data/recursive:container-root/root-list={name}", 1,
-            "/rests/data/recursive:container-root/root-list={name}/nested-list={name1}", 2,
-            "/rests/data/recursive:container-root/root-list={name}/nested-list={name1}/super-nested-list={name2}", 3);
-
-        final var doc = generator.getApiDeclaration("recursive", "2023-05-22", uriInfo);
-        assertNotNull(doc);
-
-        final var paths = doc.paths();
-        assertEquals(5, paths.size());
-
-        for (final var expectedPath : configPaths.entrySet()) {
-            assertTrue(paths.containsKey(expectedPath.getKey()));
-            final int expectedSize = expectedPath.getValue();
-
-            final var path = paths.get(expectedPath.getKey());
-
-            final var get = path.get();
-            assertNotNull(get);
-            assertEquals(expectedSize + 1, get.parameters().size());
-
-            final var put = path.put();
-            assertNotNull(put);
-            assertEquals(expectedSize, put.parameters().size());
-
-            final var delete = path.delete();
-            assertNotNull(delete);
-            assertEquals(expectedSize, delete.parameters().size());
-
-            final var patch = path.patch();
-            assertNotNull(patch);
-            assertEquals(expectedSize, patch.parameters().size());
-        }
-
-        // we do not generate POST for lists
-        final var path = paths.get("/rests/data/recursive:container-root");
-        final var post = path.post();
-        final int expectedSize = configPaths.get("/rests/data/recursive:container-root");
-        assertEquals(expectedSize, post.parameters().size());
-    }
-
-    /**
-     * Test that request parameters are correctly numbered.
-     *
-     * <p>
-     * It means we should have name and name1, etc. when we have the same parameter in path multiple times.
-     */
-    @Test
-    public void testParametersNumbering() {
-        final var doc = generator.getApiDeclaration("path-params-test", null, uriInfo);
-
-        var pathToList1 = "/rests/data/path-params-test:cont/list1={name}";
-        assertTrue(doc.paths().containsKey(pathToList1));
-        assertEquals(List.of("name"), getPathGetParameters(doc.paths(), pathToList1));
-
-        var pathToList2 = "/rests/data/path-params-test:cont/list1={name}/list2={name1}";
-        assertTrue(doc.paths().containsKey(pathToList2));
-        assertEquals(List.of("name", "name1"), getPathGetParameters(doc.paths(), pathToList2));
-
-        var pathToList3 = "/rests/data/path-params-test:cont/list3={name}";
-        assertTrue(doc.paths().containsKey(pathToList3));
-        assertEquals(List.of("name"), getPathGetParameters(doc.paths(), pathToList3));
-
-        var pathToList4 = "/rests/data/path-params-test:cont/list1={name}/list4={name1}";
-        assertTrue(doc.paths().containsKey(pathToList4));
-        assertEquals(List.of("name", "name1"), getPathGetParameters(doc.paths(), pathToList4));
-
-        var pathToList5 = "/rests/data/path-params-test:cont/list1={name}/cont2";
-        assertTrue(doc.paths().containsKey(pathToList4));
-        assertEquals(List.of("name"), getPathGetParameters(doc.paths(), pathToList5));
-    }
-
-    /**
-     * Test that request parameters are correctly typed.
-     */
-    @Test
-    public void testParametersTypes() {
-        final var doc = generator.getApiDeclaration("typed-params", "2023-10-24", uriInfo);
-        final var pathToContainer = "/rests/data/typed-params:typed/";
-        final var integerTypes = List.of("uint64", "uint32", "uint16", "uint8", "int64", "int32", "int16", "int8");
-        for (final var type: integerTypes) {
-            final var typeKey = type + "-key";
-            final var path = pathToContainer + type + "={" + typeKey + "}";
-            assertTrue(doc.paths().containsKey(path));
-            assertEquals("integer", doc.paths().get(path).get().parameters().get(0).schema().type());
-        }
-    }
-
-    /**
-     * Test that request for actions is correct and has parameters.
-     */
-    @Test
-    public void testActionPathsParams() {
-        final var doc = generator.getApiDeclaration("action-types", null, uriInfo);
-
-        final var pathWithParameters = "/rests/operations/action-types:list={name}/list-action";
-        assertTrue(doc.paths().containsKey(pathWithParameters));
-        assertEquals(List.of("name"), getPathPostParameters(doc.paths(), pathWithParameters));
-
-        final var pathWithoutParameters = "/rests/operations/action-types:multi-container/inner-container/action";
-        assertTrue(doc.paths().containsKey(pathWithoutParameters));
-        assertEquals(List.of(), getPathPostParameters(doc.paths(), pathWithoutParameters));
-    }
-
-    @Test
-    public void testSimpleOpenApiObjects() {
-        final var doc = generator.getApiDeclaration("my-yang", "2022-10-06", uriInfo);
-
-        assertEquals(Set.of("/rests/data", "/rests/data/my-yang:data"), doc.paths().keySet());
-        final var JsonNodeMyYangData = doc.paths().get("/rests/data/my-yang:data");
-        verifyRequestRef(JsonNodeMyYangData.put(), "#/components/schemas/my-yang_data", CONTAINER);
-        verifyRequestRef(JsonNodeMyYangData.get(), "#/components/schemas/my-yang_data", CONTAINER);
-
-        // Test `components/schemas` objects
-        final var definitions = doc.components().schemas();
-        assertEquals(1, definitions.size());
-        assertTrue(definitions.containsKey("my-yang_data"));
-    }
-
-    @Test
-    public void testToaster2OpenApiObjects() {
-        final var doc = generator.getApiDeclaration(TOASTER_2, REVISION_DATE, uriInfo);
-
-        final var jsonNodeToaster = doc.paths().get("/rests/data/toaster2:toaster");
-        verifyRequestRef(jsonNodeToaster.post(), "#/components/schemas/toaster2_toaster_toasterSlot", LIST);
-        verifyRequestRef(jsonNodeToaster.put(), "#/components/schemas/toaster2_toaster", CONTAINER);
-        verifyRequestRef(jsonNodeToaster.get(), "#/components/schemas/toaster2_toaster", CONTAINER);
-
-        final var jsonNodeToasterSlot = doc.paths().get("/rests/data/toaster2:toaster/toasterSlot={slotId}");
-        verifyRequestRef(jsonNodeToasterSlot.put(), "#/components/schemas/toaster2_toaster_toasterSlot", LIST);
-        verifyRequestRef(jsonNodeToasterSlot.get(), "#/components/schemas/toaster2_toaster_toasterSlot", LIST);
-
-        final var jsonNodeSlotInfo = doc.paths().get(
-            "/rests/data/toaster2:toaster/toasterSlot={slotId}/toaster-augmented:slotInfo");
-        verifyRequestRef(jsonNodeSlotInfo.put(), "#/components/schemas/toaster2_toaster_toasterSlot_slotInfo",
-            CONTAINER);
-        verifyRequestRef(jsonNodeSlotInfo.get(), "#/components/schemas/toaster2_toaster_toasterSlot_slotInfo",
-            CONTAINER);
-
-        final var jsonNodeLst = doc.paths().get("/rests/data/toaster2:lst={lf1}");
-        verifyRequestRef(jsonNodeLst.put(), "#/components/schemas/toaster2_lst", LIST);
-        verifyRequestRef(jsonNodeLst.get(), "#/components/schemas/toaster2_lst", LIST);
-
-        final var jsonNodeLst1 = doc.paths().get("/rests/data/toaster2:lst={lf1}/lst1={key1},{key2}");
-        verifyRequestRef(jsonNodeLst1.put(), "#/components/schemas/toaster2_lst_lst1", LIST);
-        verifyRequestRef(jsonNodeLst1.get(), "#/components/schemas/toaster2_lst_lst1", LIST);
-
-        final var jsonNodeMakeToast = doc.paths().get("/rests/operations/toaster2:make-toast");
-        assertNull(jsonNodeMakeToast.get());
-        verifyRequestRef(jsonNodeMakeToast.post(), "#/components/schemas/toaster2_make-toast_input", CONTAINER);
-
-        final var jsonNodeCancelToast = doc.paths().get("/rests/operations/toaster2:cancel-toast");
-        assertNull(jsonNodeCancelToast.get());
-        // Test RPC with empty input
-        final var postContent = jsonNodeCancelToast.post().requestBody().content();
-        final var jsonSchema = postContent.get("application/json").schema();
-        assertNull(jsonSchema.ref());
-        final var xmlSchema = postContent.get("application/xml").schema();
-        assertNull(xmlSchema.ref());
-
-        // Test `components/schemas` objects
-        final var definitions = doc.components().schemas();
-        assertEquals(10, definitions.size());
-    }
-
-    /**
-     * Test that checks if securitySchemes and security elements are present.
-     */
-    @Test
-    public void testAuthenticationFeature() {
-        final var doc = generator.getApiDeclaration(TOASTER_2, REVISION_DATE, uriInfo);
-
-        assertEquals("[{basicAuth=[]}]", doc.security().toString());
-        assertEquals("Http[type=http, scheme=basic, description=null, bearerFormat=null]",
-            doc.components().securitySchemes().get(BASIC_AUTH_NAME).toString());
-
-        // take list of all defined security scheme objects => all names of registered SecuritySchemeObjects
-        final var securitySchemesObjectNames = doc.components().securitySchemes().keySet();
-        assertTrue("No Security Schemes Object is defined", securitySchemesObjectNames.size() > 0);
-
-        // collect all referenced security scheme objects
-        final var referencedSecurityObjects = new HashSet<String>();
-        doc.security().forEach(map -> referencedSecurityObjects.addAll(map.keySet()));
-
-        // verify, that each reference references name of registered Security Scheme Object
-        for (final var secObjRef : referencedSecurityObjects) {
-            assertTrue(securitySchemesObjectNames.contains(secObjRef));
-        }
-    }
-
-    /**
-     * Test that checks if namespace for rpc is present.
-     */
-    @Test
-    public void testRpcNamespace() {
-        final var doc = generator.getApiDeclaration("toaster", "2009-11-20", uriInfo);
-        assertNotNull("Failed to find Datastore API", doc);
-        final var paths = doc.paths();
-        final var path = paths.get("/rests/operations/toaster:cancel-toast");
-        assertNotNull(path);
-        final var content = path.post().requestBody().content().get("application/xml");
-        assertNotNull(content);
-        final var schema = content.schema();
-        assertNotNull(schema);
-        final var xml = schema.xml();
-        assertNotNull(xml);
-        final var namespace = xml.namespace();
-        assertNotNull(namespace);
-        assertEquals("http://netconfcentral.org/ns/toaster", namespace);
-    }
-
-    /**
-     * Test that checks if namespace for actions is present.
-     */
-    @Test
-    public void testActionsNamespace() {
-        final var doc = generator.getApiDeclaration("action-types", null, uriInfo);
-        assertNotNull("Failed to find Datastore API", doc);
-        final var paths = doc.paths();
-        final var path = paths.get("/rests/operations/action-types:multi-container/inner-container/action");
-        assertNotNull(path);
-        final var content = path.post().requestBody().content().get("application/xml");
-        assertNotNull(content);
-        final var schema = content.schema();
-        assertNotNull(schema);
-        final var xml = schema.xml();
-        assertNotNull(xml);
-        final var namespace = xml.namespace();
-        assertNotNull(namespace);
-        assertEquals("urn:ietf:params:xml:ns:yang:test:action:types", namespace);
-    }
-
-    /**
-     * Test that checks if list min-elements and max-elements are present.
-     * Also checks if number of example elements meets the min-elements condition
-     * and if key defined leaf have unique values.
-     */
-    @Test
-    public void testListExamplesWithNonKeyLeaf() {
-        final var doc = generator.getApiDeclaration("test-container-childs", "2023-09-28", uriInfo);
-        assertNotNull("Failed to find Datastore API", doc);
-        final var components = doc.components();
-        final var component = components.schemas().get("test-container-childs_root-container_nested-container");
-        assertNotNull(component);
-        assertNotNull(component.properties());
-        final var property = component.properties().get("mandatory-list");
-        assertNotNull(property);
-        assertNotNull(property.minItems());
-        assertNotNull(property.maxItems());
-        assertEquals(3, (int) property.minItems());
-        assertEquals(5, (int) property.maxItems());
-        final var example = property.example();
-        assertNotNull(example);
-        assertEquals(3, ((List<?>)example).size());
-        assertTrue(checkUniqueExample(example, "id"));
-    }
-
-    /**
-     * Test that checks if multiple key leafs have unique values.
-     * Also checks if nested container node is ignored.
-     */
-    @Test
-    public void testListExamplesWithTwoKeys() {
-        final var doc = generator.getApiDeclaration("test-container-childs", "2023-09-28", uriInfo);
-        assertNotNull("Failed to find Datastore API", doc);
-        final var components = doc.components();
-        final var component = components.schemas()
-            .get("test-container-childs_root-container-two-keys_nested-container-two-keys");
-        assertNotNull(component);
-        assertNotNull(component.properties());
-        final var property = component.properties().get("mandatory-list-two-keys");
-        assertNotNull(property);
-        final var example = property.example();
-        assertNotNull(example);
-        assertTrue(checkUniqueExample(example, "id"));
-        assertTrue(checkUniqueExample(example, "name"));
-        assertEquals(3, ((ArrayList<Map<?,?>>)example).get(0).size());
-    }
-
-    /**
-     * Test that checks if sets of unique defined leafs have unique combination of values.
-     */
-    @Test
-    public void testListExamplesWithUnique() {
-        final var doc = generator.getApiDeclaration("test-container-childs", "2023-09-28", uriInfo);
-        assertNotNull("Failed to find Datastore API", doc);
-        final var components = doc.components();
-        final var component = components.schemas()
-            .get("test-container-childs_root-container-unique_nested-container-unique");
-        assertNotNull(component);
-        assertNotNull(component.properties());
-        final var property = component.properties().get("mandatory-list-unique");
-        assertNotNull(property);
-        final var example = property.example();
-        assertNotNull(example);
-        assertTrue(checkUniqueExample(example, "id"));
-        assertTrue(checkUniqueExample(example, "name") || checkUniqueExample(example, "address"));
-    }
-
-    private static boolean checkUniqueExample(final Object examples, final String key) {
-        assertEquals(ArrayList.class, examples.getClass());
-        final var exampleValues = new HashSet<>();
-
-        for (final Map<String, Object> example : (ArrayList<Map<String, Object>>)examples) {
-            exampleValues.add(example.get(key));
-        }
-        return (exampleValues.size() == ((ArrayList<?>) examples).size());
-    }
-
-    /**
-     * Test that number of elements in payload is correct.
-     */
-    @SuppressWarnings("unchecked")
-    @Test
-    public void testLeafListWithMinElementsPayload() {
-        final var doc = generator.getApiDeclaration(MANDATORY_TEST, null, uriInfo);
-        assertNotNull(doc);
-        final var paths = doc.paths();
-        final var path = paths.get("/rests/data/mandatory-test:root-container/mandatory-container");
-        assertNotNull(path);
-        final var requestBody = path.put().requestBody().content();
-        assertNotNull(requestBody);
-        final var jsonRef = requestBody.get("application/json").schema().properties()
-            .get("mandatory-test:mandatory-container").ref();
-        assertNotNull(jsonRef);
-        final var xmlRef = requestBody.get("application/xml").schema().ref();
-        assertNotNull(xmlRef);
-        final var schema = doc.components().schemas().get("mandatory-test_root-container_mandatory-container");
-        assertNotNull(schema);
-        final var minItems = schema.properties().get("leaf-list-with-min-elements").minItems();
-        assertNotNull(minItems);
-        final var listOfExamples = ((List<String>) schema.properties().get("leaf-list-with-min-elements").example());
-        assertNotNull(listOfExamples);
-        assertEquals(jsonRef, xmlRef);
-        assertEquals(listOfExamples.size(), minItems.intValue());
-    }
-
-    private static void verifyRequestRef(final Operation operation, final String expectedRef, final String nodeType) {
-        final Map<String, MediaTypeObject> postContent;
-        if (operation.requestBody() != null) {
-            postContent = operation.requestBody().content();
-        } else {
-            postContent = operation.responses().get("200").content();
-        }
-        assertNotNull(postContent);
-        final String postJsonRef;
-        if (nodeType.equals(CONTAINER)) {
-            postJsonRef = postContent.get("application/json").schema().properties().values().iterator().next().ref();
-        } else {
-            postJsonRef = postContent.get("application/json").schema().properties().values().iterator().next().items()
-                .ref();
-        }
-        assertNotNull(postJsonRef);
-        assertEquals(expectedRef, postJsonRef);
-        final var postXmlRef = postContent.get("application/xml").schema().ref();
-        assertNotNull(postXmlRef);
-        assertEquals(expectedRef, postXmlRef);
-    }
-
-    private static void verifyThatOthersNodeDoesNotHaveRequiredField(final List<String> expected,
-            final Map<String, Schema> schemas) {
-        for (final var schema : schemas.entrySet()) {
-            if (expected.contains(schema.getKey())) {
-                continue;
-            }
-            assertNull("Json node " + schema.getKey() + " should not have 'required' field in body",
-                schema.getValue().required());
-        }
-    }
-
-    private static void verifyRequiredField(final Schema rootContainer, final List<String> expected) {
-        assertNotNull(rootContainer);
-        final var required = rootContainer.required();
-        assertNotNull(required);
-        assertEquals(expected, required);
-    }
-
-    private static Set<String> extractSchemaRefFromPath(final Path path) {
-        if (path == null) {
-            return Set.of();
-        }
-        final var references = new HashSet<String>();
-        final var get = path.get();
-        if (get != null) {
-            references.addAll(schemaRefFromContent(get.responses().get("200").content()));
-        }
-        final var post = path.post();
-        if (post != null) {
-            references.addAll(schemaRefFromContent(post.requestBody().content()));
-        }
-        final var put = path.put();
-        if (put != null) {
-            references.addAll(schemaRefFromContent(put.requestBody().content()));
-        }
-        final var patch = path.patch();
-        if (patch != null) {
-            references.addAll(schemaRefFromContent(patch.requestBody().content()));
-        }
-        return references;
-    }
-
-    /**
-     * The schema node does not have 1 specific structure and the "$ref" child is not always the first child after
-     * schema. Possible schema structures include:
-     * <ul>
-     *   <li>schema/$ref/{reference}</li>
-     *   <li>schema/properties/{nodeName}/$ref/{reference}</li>
-     *   <li>schema/properties/{nodeName}/items/$ref/{reference}</li>
-     * </ul>
-     * @param content the element identified with key "content"
-     * @return the set of referenced schemas
-     */
-    private static Set<String> schemaRefFromContent(final Map<String, MediaTypeObject> content) {
-        final HashSet<String> refs = new HashSet<>();
-        content.values().forEach(mediaType -> {
-            final var schema = mediaType.schema();
-            final var props = mediaType.schema().properties();
-            final String ref;
-            if (props == null) {
-                // either there is no node with the key "properties", try to find immediate child of schema
-                ref = schema.ref();
-            } else if (props.values().iterator().next().items() == null) {
-                // or the "properties" is defined and under that we didn't find the "items" node
-                // try to get "$ref" as immediate child under properties
-                ref = props.values().iterator().next().ref();
-            } else {
-                // or the "items" node is defined, in which case we try to get the "$ref" from this node
-                ref = props.values().iterator().next().items().ref();
-            }
-
-            if (ref != null) {
-                refs.add(ref.replaceFirst(COMPONENTS_PREFIX, ""));
-            }
-        });
-        return refs;
-    }
-}
diff --git a/restconf/restconf-openapi/src/test/java/org/opendaylight/restconf/openapi/impl/OpenApiServiceImplTest.java b/restconf/restconf-openapi/src/test/java/org/opendaylight/restconf/openapi/impl/OpenApiServiceImplTest.java
deleted file mode 100644 (file)
index 75e8dc4..0000000
+++ /dev/null
@@ -1,71 +0,0 @@
-/*
- * Copyright (c) 2018 ZTE Corporation and others.  All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- */
-package org.opendaylight.restconf.openapi.impl;
-
-import static org.junit.Assert.assertEquals;
-import static org.mockito.Mockito.mock;
-import static org.mockito.Mockito.when;
-
-import java.util.List;
-import java.util.Optional;
-import org.junit.Before;
-import org.junit.BeforeClass;
-import org.junit.Test;
-import org.opendaylight.mdsal.dom.api.DOMMountPoint;
-import org.opendaylight.mdsal.dom.api.DOMMountPointService;
-import org.opendaylight.mdsal.dom.api.DOMSchemaService;
-import org.opendaylight.restconf.openapi.DocGenTestHelper;
-import org.opendaylight.restconf.openapi.api.OpenApiService;
-import org.opendaylight.restconf.openapi.model.MountPointInstance;
-import org.opendaylight.yangtools.yang.common.QName;
-import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
-import org.opendaylight.yangtools.yang.model.api.EffectiveModelContext;
-import org.opendaylight.yangtools.yang.test.util.YangParserTestUtils;
-
-public final class OpenApiServiceImplTest {
-    private static final String HTTP_URL = "http://localhost/path";
-    private static final YangInstanceIdentifier INSTANCE_ID = YangInstanceIdentifier.builder()
-            .node(QName.create("", "nodes"))
-            .node(QName.create("", "node"))
-            .nodeWithKey(QName.create("", "node"), QName.create("", "id"), "123").build();
-
-    private static EffectiveModelContext context;
-    private static DOMSchemaService schemaService;
-
-    private OpenApiService openApiService;
-
-    @BeforeClass
-    public static void beforeClass() {
-        schemaService = mock(DOMSchemaService.class);
-        context = YangParserTestUtils.parseYangResourceDirectory("/yang");
-        when(schemaService.getGlobalContext()).thenReturn(context);
-    }
-
-    @Before
-    public void before() {
-        final DOMMountPoint mountPoint = mock(DOMMountPoint.class);
-        when(mountPoint.getService(DOMSchemaService.class)).thenReturn(Optional.of(schemaService));
-
-        final DOMMountPointService service = mock(DOMMountPointService.class);
-        when(service.getMountPoint(INSTANCE_ID)).thenReturn(Optional.of(mountPoint));
-        final MountPointOpenApiGeneratorRFC8040 mountPointRFC8040 =
-                new MountPointOpenApiGeneratorRFC8040(schemaService, service);
-        final OpenApiGeneratorRFC8040 openApiGeneratorRFC8040 = new OpenApiGeneratorRFC8040(schemaService);
-        mountPointRFC8040.getMountPointOpenApi().onMountPointCreated(INSTANCE_ID);
-        openApiService = new OpenApiServiceImpl(mountPointRFC8040, openApiGeneratorRFC8040);
-    }
-
-    @Test
-    public void getListOfMounts() throws Exception {
-        final var mockInfo = DocGenTestHelper.createMockUriInfo(HTTP_URL);
-        final var entity = ((List<MountPointInstance>) openApiService.getListOfMounts(mockInfo).getEntity());
-        final var instance = entity.get(0);
-        assertEquals("/nodes/node=123/", instance.instance());
-        assertEquals(Long.valueOf(1), instance.id());
-    }
-}
diff --git a/restconf/restconf-openapi/src/test/java/org/opendaylight/restconf/openapi/impl/OpenApiXmlNamespaceTest.java b/restconf/restconf-openapi/src/test/java/org/opendaylight/restconf/openapi/impl/OpenApiXmlNamespaceTest.java
deleted file mode 100644 (file)
index 8ea5ec5..0000000
+++ /dev/null
@@ -1,171 +0,0 @@
-/*
- * Copyright (c) 2023 PANTHEON.tech, s.r.o. and others.  All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- */
-package org.opendaylight.restconf.openapi.impl;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertNull;
-import static org.mockito.Mockito.mock;
-import static org.mockito.Mockito.when;
-
-import java.util.Map;
-import org.junit.BeforeClass;
-import org.junit.Test;
-import org.opendaylight.mdsal.dom.api.DOMSchemaService;
-import org.opendaylight.restconf.openapi.DocGenTestHelper;
-import org.opendaylight.restconf.openapi.model.Schema;
-import org.opendaylight.yangtools.yang.test.util.YangParserTestUtils;
-
-/**
- * Test if "xml" nodes are added with correct namespace.
- *
- * <p>
- * We only want to see namespace when it's different from parent's namespace. XML namespace is also in every
- * container and list node. The container and list nodes have namespaces because they refer to other schema objects
- * that can be invoked independently.
- */
-public class OpenApiXmlNamespaceTest {
-    private static final String TEST_AUGMENTATION_NAMESPACE = "urn:ietf:params:xml:ns:yang:test:augmentation";
-    private static final String TEST_MODULE_NAMESPACE = "urn:ietf:params:xml:ns:yang:test:module";
-    private static final String MODULE = """
-        module module {
-          yang-version 1.1;
-          namespace "urn:ietf:params:xml:ns:yang:test:module";
-          prefix "mod";
-          container root {
-            container simple-root {
-              leaf leaf-a {
-                type string;
-              }
-              leaf leaf-b {
-                type string;
-              }
-            }
-            list top-list {
-              key "key-1 key-2";
-
-              leaf key-1 {
-                type string;
-              }
-              leaf key-2 {
-                type string;
-              }
-            }
-          }
-        }
-        """;
-    private static final String AUG_MODULE = """
-        module augmentation {
-          yang-version 1.1;
-          namespace "urn:ietf:params:xml:ns:yang:test:augmentation";
-          prefix "aug";
-          import module {
-            prefix mod;
-          }
-
-          grouping data-1 {
-            list list-1 {
-              key "leaf-x";
-              leaf leaf-x {
-                type string;
-              }
-            }
-          }
-
-          grouping data-2 {
-            container abc {
-              leaf leaf-abc {
-                type boolean;
-              }
-            }
-          }
-
-          augment "/mod:root/mod:simple-root" {
-            uses data-1;
-          }
-          augment "/mod:root/mod:simple-root" {
-            uses data-2;
-          }
-          augment "/mod:root/mod:simple-root" {
-            leaf leaf-y {
-              type string;
-            }
-          }
-
-          augment "/mod:root/mod:top-list" {
-            uses data-1;
-          }
-          augment "/mod:root/mod:top-list" {
-            uses data-2;
-          }
-          augment "/mod:root/mod:top-list" {
-            leaf leaf-y {
-              type string;
-            }
-          }
-        }
-        """;
-
-    private static Map<String, Schema> schemas;
-
-    @BeforeClass
-    public static void startUp() throws Exception {
-        final var context1036 = YangParserTestUtils.parseYang(MODULE, AUG_MODULE);
-        final var mockSchemaService = mock(DOMSchemaService.class);
-        when(mockSchemaService.getGlobalContext()).thenReturn(context1036);
-        final var generatorRFC8040 = new OpenApiGeneratorRFC8040(mockSchemaService);
-        final var uriInfo = DocGenTestHelper.createMockUriInfo("http://localhost/path");
-        final var doc = generatorRFC8040.getApiDeclaration("module", null, uriInfo);
-        assertNotNull(doc);
-        schemas = doc.components().schemas();
-    }
-
-    @Test
-    public void testAugmentedListInContainer() {
-        final var simpleList1 = schemas.get("module_root_simple-root_list-1");
-        assertEquals(TEST_AUGMENTATION_NAMESPACE, simpleList1.xml().namespace());
-        assertNull(simpleList1.properties().get("leaf-x").xml());
-    }
-
-    @Test
-    public void testAugmentedContainerInContainer() {
-        final var simpleAbc = schemas.get("module_root_simple-root_abc");
-        assertEquals(TEST_AUGMENTATION_NAMESPACE, simpleAbc.xml().namespace());
-        assertNull(simpleAbc.properties().get("leaf-abc").xml());
-    }
-
-    @Test
-    public void testAugmentedLeafInContainer() {
-        final var simple = schemas.get("module_root_simple-root");
-        assertEquals(TEST_MODULE_NAMESPACE, simple.xml().namespace());
-        assertEquals(TEST_AUGMENTATION_NAMESPACE, simple.properties().get("leaf-y").xml().namespace());
-        assertNull(simple.properties().get("leaf-a").xml());
-    }
-
-    @Test
-    public void testAugmentedListInList() {
-        final var topList1 = schemas.get("module_root_top-list_list-1");
-        assertEquals(TEST_AUGMENTATION_NAMESPACE, topList1.xml().namespace());
-        assertNull(topList1.properties().get("leaf-x").xml());
-    }
-
-    @Test
-    public void testAugmentedContainerInList() {
-        final var topAbc = schemas.get("module_root_top-list_abc");
-        assertEquals(TEST_AUGMENTATION_NAMESPACE, topAbc.xml().namespace());
-        assertNull(topAbc.properties().get("leaf-abc").xml());
-    }
-
-    @Test
-    public void testAugmentedLeafInList() {
-        final var top = schemas.get("module_root_top-list");
-        assertEquals(TEST_MODULE_NAMESPACE, top.xml().namespace());
-        assertEquals(TEST_AUGMENTATION_NAMESPACE, top.properties().get("leaf-y").xml().namespace());
-        assertNull(top.properties().get("key-1").xml());
-    }
-}
diff --git a/restconf/restconf-openapi/src/test/java/org/opendaylight/restconf/openapi/impl/PostPayloadTest.java b/restconf/restconf-openapi/src/test/java/org/opendaylight/restconf/openapi/impl/PostPayloadTest.java
deleted file mode 100644 (file)
index e2d5fd3..0000000
+++ /dev/null
@@ -1,171 +0,0 @@
-/*
- * Copyright (c) 2023 PANTHEON.tech, s.r.o. and others.  All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- */
-package org.opendaylight.restconf.openapi.impl;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertTrue;
-import static org.mockito.Mockito.mock;
-import static org.mockito.Mockito.when;
-
-import org.junit.BeforeClass;
-import org.junit.Test;
-import org.opendaylight.mdsal.dom.api.DOMSchemaService;
-import org.opendaylight.restconf.openapi.DocGenTestHelper;
-import org.opendaylight.restconf.openapi.model.OpenApiObject;
-import org.opendaylight.yangtools.yang.test.util.YangParserTestUtils;
-
-/**
- * These tests are designed to verify that the specified path contains corresponding references in post requests
- * which contains lists and containers.
- *
- * <p>
- * The purpose of this test is to ensure that the specified path in the document contains the necessary references
- * in its post requests for both JSON and XML content types. It verifies that the expected structure is in place,
- * and the application can successfully retrieve the corresponding references for further processing.
- */
-public class PostPayloadTest {
-
-    private static final String CONTAINER_TEST = """
-            module container-test {
-              namespace "urn:opendaylight:params:xml:ns:yang:netconf:monitoring:cont-test";
-              prefix "ctest";
-              revision 2023-07-31 {
-                description "Test model.";
-              }
-              container cont {
-                container cont1 {
-                  list list4 {
-                    key "key4";
-                    leaf key4 {
-                      type string;
-                    }
-                    leaf value4 {
-                      type string;
-                    }
-                    container cont2 {
-                      leaf value7 {
-                        type string;
-                      }
-                      list list5 {
-                        key "key5";
-                        leaf key5 {
-                         type string;
-                        }
-                        leaf value5 {
-                          type string;
-                        }
-                      }
-                    }
-                  }
-                }
-              }
-            }""";
-    private static final String LIST_TEST = """
-            module list-test {
-              namespace "urn:opendaylight:params:xml:ns:yang:netconf:monitoring:list-test";
-              prefix "ltest";
-              revision 2023-07-31 {
-                description "Test model.";
-              }
-              container cont {
-                list list1 {
-                  key "key1";
-                  leaf key1 {
-                    type string;
-                  }
-                  leaf value1 {
-                    type string;
-                  }
-                }
-                list list2 {
-                  key "key2";
-                  leaf key2 {
-                    type string;
-                  }
-                  leaf value2 {
-                    type string;
-                  }
-                  list list3 {
-                    key "key3";
-                    leaf key3 {
-                      type string;
-                    }
-                    leaf value3 {
-                      type string;
-                    }
-                  }
-                }
-              }
-            }""";
-
-    private static OpenApiObject containerDoc;
-    private static OpenApiObject listDoc;
-
-    @BeforeClass
-    public static void startUp() throws Exception {
-        final var context = YangParserTestUtils.parseYang(CONTAINER_TEST, LIST_TEST);
-        final var schemaService = mock(DOMSchemaService.class);
-        when(schemaService.getGlobalContext()).thenReturn(context);
-        final var generator = new OpenApiGeneratorRFC8040(schemaService);
-        final var uriInfo = DocGenTestHelper.createMockUriInfo("http://localhost/path");
-        containerDoc = generator.getApiDeclaration("container-test", "2023-07-31", uriInfo);
-        assertNotNull(containerDoc);
-        listDoc = generator.getApiDeclaration("list-test", "2023-07-31", uriInfo);
-        assertNotNull(listDoc);
-    }
-
-    @Test
-    public void testContainersPostPayloads() {
-        final var path1 = "/rests/data/container-test:cont";
-        assertTrue(containerDoc.paths().containsKey(path1));
-        final var jsonRef1 = getJsonRef(containerDoc, path1);
-        assertEquals("#/components/schemas/container-test_cont_cont1", jsonRef1);
-        final var xmlRef1 = getXmlRef(containerDoc, path1);
-        assertEquals("#/components/schemas/container-test_cont_cont1", xmlRef1);
-
-        final var path2 = "/rests/data/container-test:cont/cont1";
-        assertTrue(containerDoc.paths().containsKey(path2));
-        final var jsonRef2 = getJsonRef(containerDoc, path2);
-        assertEquals("#/components/schemas/container-test_cont_cont1_list4", jsonRef2);
-        final var xmlRef2 = getXmlRef(containerDoc, path2);
-        assertEquals("#/components/schemas/container-test_cont_cont1_list4", xmlRef2);
-
-        final var path4 = "/rests/data/container-test:cont/cont1/list4={key4}/cont2";
-        assertTrue(containerDoc.paths().containsKey(path4));
-        final var jsonRef4 = getJsonRef(containerDoc, path4);
-        assertEquals("#/components/schemas/container-test_cont_cont1_list4_cont2_list5", jsonRef4);
-        final var xmlRef4 = getXmlRef(containerDoc, path4);
-        assertEquals("#/components/schemas/container-test_cont_cont1_list4_cont2_list5", xmlRef4);
-    }
-
-    @Test
-    public void testListsPostPayloads() {
-        final var path1 = "/rests/data/list-test:cont";
-        assertTrue(listDoc.paths().containsKey(path1));
-        final var jsonRef1 = getJsonRef(listDoc, path1);
-        assertEquals("#/components/schemas/list-test_cont_list1", jsonRef1);
-        final var xmlRef1 = getXmlRef(listDoc, path1);
-        assertEquals("#/components/schemas/list-test_cont_list1", xmlRef1);
-    }
-
-    private static String getJsonRef(final OpenApiObject openApiObject, final String path) {
-        final var property = openApiObject.paths().get(path).post().requestBody().content().get("application/json")
-            .schema().properties().values().iterator().next();
-        if (property.type().equals("object")) {
-            return property.ref();
-        } else {
-            return property.items().ref();
-        }
-    }
-
-    private static String getXmlRef(final OpenApiObject openApiObject, final String path) {
-        return openApiObject.paths().get(path).post().requestBody().content().get(
-            "application/xml").schema().ref();
-    }
-}
diff --git a/restconf/restconf-openapi/src/test/java/org/opendaylight/restconf/openapi/mountpoints/CustomOpenApiBasePathTest.java b/restconf/restconf-openapi/src/test/java/org/opendaylight/restconf/openapi/mountpoints/CustomOpenApiBasePathTest.java
deleted file mode 100644 (file)
index 31430a8..0000000
+++ /dev/null
@@ -1,128 +0,0 @@
-/*
- * Copyright (c) 2023 PANTHEON.tech, s.r.o. and others.  All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- */
-package org.opendaylight.restconf.openapi.mountpoints;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.mockito.Mockito.mock;
-import static org.mockito.Mockito.when;
-
-import java.util.Collection;
-import java.util.List;
-import java.util.Optional;
-import java.util.Set;
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.junit.runners.Parameterized;
-import org.junit.runners.Parameterized.Parameter;
-import org.junit.runners.Parameterized.Parameters;
-import org.opendaylight.mdsal.dom.api.DOMMountPoint;
-import org.opendaylight.mdsal.dom.api.DOMMountPointService;
-import org.opendaylight.mdsal.dom.api.DOMSchemaService;
-import org.opendaylight.restconf.openapi.DocGenTestHelper;
-import org.opendaylight.restconf.openapi.impl.MountPointOpenApiGeneratorRFC8040;
-import org.opendaylight.yangtools.yang.common.QName;
-import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
-import org.opendaylight.yangtools.yang.test.util.YangParserTestUtils;
-
-@RunWith(Parameterized.class)
-public final class CustomOpenApiBasePathTest {
-    private static final YangInstanceIdentifier INSTANCE_ID = YangInstanceIdentifier.builder()
-            .node(QName.create("", "nodes"))
-            .node(QName.create("", "node"))
-            .nodeWithKey(QName.create("", "node"), QName.create("", "id"), "123").build();
-
-    private MountPointOpenApi openApi;
-
-    @Parameter
-    public static String basePath;
-
-    @Parameters(name = "{0}")
-    public static Collection<String> data() {
-        return List.of("rests", "restconf");
-    }
-
-    @Before
-    public void before() {
-        final var schemaService = mock(DOMSchemaService.class);
-        final var context = YangParserTestUtils.parseYang("""
-            module custom-base-path-test {
-              yang-version 1.1;
-              namespace urn:opendaylight:action-path-test;
-              prefix "path-test";
-
-              revision "2023-05-30" {
-                description
-                "Initial revision.";
-              }
-
-              rpc rpc-call {
-                input {
-                  leaf rpc-call-input {
-                    type string;
-                  }
-                }
-                output {
-                  leaf rpc-call-output {
-                    type string;
-                  }
-                }
-              }
-
-              container foo {
-                list foo-list {
-                  key "fooListKey";
-                  leaf fooListKey {
-                    type string;
-                  }
-                }
-                action foo-action {
-                  input {
-                    leaf foo-action-input {
-                      type string;
-                    }
-                  }
-                  output {
-                    leaf foo-action-output {
-                      type string;
-                    }
-                  }
-                }
-              }
-            }
-            """);
-
-        when(schemaService.getGlobalContext()).thenReturn(context);
-        final var mountPoint = mock(DOMMountPoint.class);
-        when(mountPoint.getService(DOMSchemaService.class)).thenReturn(Optional.of(schemaService));
-        final var mountPointService = mock(DOMMountPointService.class);
-        when(mountPointService.getMountPoint(INSTANCE_ID)).thenReturn(Optional.of(mountPoint));
-        final var generator = new MountPointOpenApiGeneratorRFC8040(schemaService, mountPointService, basePath);
-        openApi = generator.getMountPointOpenApi();
-        openApi.onMountPointCreated(INSTANCE_ID);
-    }
-
-    @Test
-    public void testCustomOpenApiBasePath() throws Exception {
-        final var mockInfo = DocGenTestHelper.createMockUriInfo("http://localhost/path");
-        final var mountPointApi = openApi.getMountPointApi(mockInfo, 1L, "custom-base-path-test", "2023-05-30");
-        assertNotNull("Failed to find Datastore API", mountPointApi);
-
-        final var containerOperationRoot = "/" + basePath + "/operations/nodes/node=123/yang-ext:mount";
-        final var containerDataRoot = "/" + basePath + "/data/nodes/node=123/yang-ext:mount";
-        final var expectedPaths = Set.of(
-            containerOperationRoot + "/custom-base-path-test:rpc-call",
-            containerOperationRoot + "/custom-base-path-test:foo/foo-action",
-            containerDataRoot + "/custom-base-path-test:foo/foo-list={fooListKey}",
-            containerDataRoot + "/custom-base-path-test:foo",
-            containerDataRoot);
-
-        assertEquals("Unexpected paths", expectedPaths, mountPointApi.paths().keySet());
-    }
-}
diff --git a/restconf/restconf-openapi/src/test/java/org/opendaylight/restconf/openapi/mountpoints/MountPointOpenApiTest.java b/restconf/restconf-openapi/src/test/java/org/opendaylight/restconf/openapi/mountpoints/MountPointOpenApiTest.java
deleted file mode 100644 (file)
index 6a64195..0000000
+++ /dev/null
@@ -1,443 +0,0 @@
-/*
- * Copyright (c) 2014 Brocade Communications Systems, Inc. and others.  All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- */
-package org.opendaylight.restconf.openapi.mountpoints;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertTrue;
-import static org.mockito.Mockito.mock;
-import static org.mockito.Mockito.when;
-import static org.opendaylight.restconf.openapi.OpenApiTestUtils.getPathGetParameters;
-import static org.opendaylight.restconf.openapi.OpenApiTestUtils.getPathPostParameters;
-import static org.opendaylight.restconf.openapi.impl.BaseYangOpenApiGenerator.BASIC_AUTH_NAME;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Map;
-import java.util.Optional;
-import java.util.Set;
-import java.util.TreeSet;
-import java.util.stream.Collectors;
-import javax.ws.rs.core.UriInfo;
-import org.glassfish.jersey.internal.util.collection.ImmutableMultivaluedMap;
-import org.junit.Before;
-import org.junit.BeforeClass;
-import org.junit.Test;
-import org.opendaylight.mdsal.dom.api.DOMMountPoint;
-import org.opendaylight.mdsal.dom.api.DOMMountPointService;
-import org.opendaylight.mdsal.dom.api.DOMSchemaService;
-import org.opendaylight.restconf.openapi.DocGenTestHelper;
-import org.opendaylight.restconf.openapi.impl.MountPointOpenApiGeneratorRFC8040;
-import org.opendaylight.restconf.openapi.model.OpenApiObject;
-import org.opendaylight.restconf.openapi.model.Operation;
-import org.opendaylight.restconf.openapi.model.Path;
-import org.opendaylight.yangtools.yang.common.QName;
-import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
-import org.opendaylight.yangtools.yang.model.api.EffectiveModelContext;
-import org.opendaylight.yangtools.yang.test.util.YangParserTestUtils;
-
-public final class MountPointOpenApiTest {
-    private static final String TOASTER = "toaster";
-    private static final String TOASTER_REVISION = "2009-11-20";
-    private static final Long DEVICE_ID = 1L;
-    private static final String DEVICE_NAME = "123";
-    private static final String TOASTER_NODE_PATH = "/rests/data/nodes/node=123/yang-ext:mount/toaster:toaster";
-    private static final String TOASTER_NODE_GET_SUMMARY = "GET - " + DEVICE_NAME + " - toaster - toaster";
-    private static final String GET_ALL = "http://localhost:8181/openapi/api/v3/mounts/" + DEVICE_ID;
-    private static final String GET_TOASTER = "http://localhost:8181/openapi/api/v3/mounts/%s/%s(%s)".formatted(
-        DEVICE_ID, TOASTER, TOASTER_REVISION);
-    private static final String HTTP_URL = "http://localhost/path";
-    private static final YangInstanceIdentifier INSTANCE_ID = YangInstanceIdentifier.builder()
-            .node(QName.create("", "nodes"))
-            .node(QName.create("", "node"))
-            .nodeWithKey(QName.create("", "node"), QName.create("", "id"), DEVICE_NAME).build();
-    private static final String INSTANCE_URL = "/nodes/node=123/";
-
-    private static EffectiveModelContext context;
-    private static DOMSchemaService schemaService;
-
-    private MountPointOpenApi openApi;
-    private UriInfo uriDeviceAll;
-    private UriInfo uriDeviceToaster;
-
-    @BeforeClass
-    public static void beforeClass() {
-        schemaService = mock(DOMSchemaService.class);
-        context = YangParserTestUtils.parseYangResourceDirectory("/yang");
-        when(schemaService.getGlobalContext()).thenReturn(context);
-    }
-
-    @Before
-    public void before() throws Exception {
-        // We are sharing the global schema service and the mount schema service
-        // in our test.
-        // OK for testing - real thing would have separate instances.
-        final DOMMountPoint mountPoint = mock(DOMMountPoint.class);
-        when(mountPoint.getService(DOMSchemaService.class)).thenReturn(Optional.of(schemaService));
-
-        final DOMMountPointService service = mock(DOMMountPointService.class);
-        when(service.getMountPoint(INSTANCE_ID)).thenReturn(Optional.of(mountPoint));
-
-        openApi = new MountPointOpenApiGeneratorRFC8040(schemaService, service).getMountPointOpenApi();
-
-        uriDeviceAll = DocGenTestHelper.createMockUriInfo(GET_ALL);
-        when(uriDeviceAll.getQueryParameters()).thenReturn(ImmutableMultivaluedMap.empty());
-        uriDeviceToaster = DocGenTestHelper.createMockUriInfo(GET_TOASTER);
-        when(uriDeviceToaster.getQueryParameters()).thenReturn(ImmutableMultivaluedMap.empty());
-    }
-
-    @Test()
-    public void getInstanceIdentifiers() {
-        assertEquals(0, openApi.getInstanceIdentifiers().size());
-        openApi.onMountPointCreated(INSTANCE_ID); // add this ID into the list of mount points
-        assertEquals(1, openApi.getInstanceIdentifiers().size());
-        assertEquals((Long) 1L, openApi.getInstanceIdentifiers().entrySet().iterator().next()
-                .getValue());
-        assertEquals(INSTANCE_URL, openApi.getInstanceIdentifiers().entrySet().iterator().next()
-                .getKey());
-        openApi.onMountPointRemoved(INSTANCE_ID); // remove ID from list of mount points
-        assertEquals(0, openApi.getInstanceIdentifiers().size());
-    }
-
-    @Test
-    public void testGetDataStoreApi() throws Exception {
-        final UriInfo mockInfo = DocGenTestHelper.createMockUriInfo(HTTP_URL);
-        openApi.onMountPointCreated(INSTANCE_ID); // add this ID into the list of mount points
-
-        final OpenApiObject mountPointApi = openApi.getMountPointApi(mockInfo, 1L, "Datastores", "-");
-        assertNotNull("Failed to find Datastore API", mountPointApi);
-
-        final Map<String, Path> paths = mountPointApi.paths();
-        assertNotNull(paths);
-
-        assertEquals("Unexpected api list size", 2, paths.size());
-
-        final Set<String> actualUrls = new TreeSet<>();
-
-        for (final Map.Entry<String, Path> path : paths.entrySet()) {
-            actualUrls.add(path.getKey());
-            final Operation getOperation = path.getValue().get();
-            assertNotNull("Unexpected operation method on " + path, getOperation);
-            assertNotNull("Expected non-null desc on " + path, getOperation.description());
-        }
-
-        assertEquals(Set.of("/rests/data" + INSTANCE_URL + "yang-ext:mount",
-            "/rests/operations" + INSTANCE_URL + "yang-ext:mount"), actualUrls);
-    }
-
-    /**
-     * Test that creates mount point api with all models from yang folder and checks operation paths for these models.
-     */
-    @Test
-    public void testGetMountPointApi() throws Exception {
-        final UriInfo mockInfo = DocGenTestHelper.createMockUriInfo(HTTP_URL);
-        openApi.onMountPointCreated(INSTANCE_ID);
-
-        final OpenApiObject mountPointApi = openApi.getMountPointApi(mockInfo, 1L, null);
-        assertNotNull("Failed to find Datastore API", mountPointApi);
-
-        final Map<String, Path> paths = mountPointApi.paths();
-        assertNotNull(paths);
-
-        assertEquals("Unexpected api list size", 78, paths.size());
-
-        final List<Operation> getOperations = new ArrayList<>();
-        final List<Operation> postOperations = new ArrayList<>();
-        final List<Operation> putOperations = new ArrayList<>();
-        final List<Operation> patchOperations = new ArrayList<>();
-        final List<Operation> deleteOperations = new ArrayList<>();
-
-        for (final Map.Entry<String, Path> path : paths.entrySet()) {
-            Optional.ofNullable(path.getValue().get()).ifPresent(getOperations::add);
-            Optional.ofNullable(path.getValue().post()).ifPresent(postOperations::add);
-            Optional.ofNullable(path.getValue().put()).ifPresent(putOperations::add);
-            Optional.ofNullable(path.getValue().patch()).ifPresent(patchOperations::add);
-            Optional.ofNullable(path.getValue().delete()).ifPresent(deleteOperations::add);
-        }
-
-        assertEquals("Unexpected GET paths size", 70, getOperations.size());
-        assertEquals("Unexpected POST paths size", 21, postOperations.size());
-        assertEquals("Unexpected PUT paths size", 68, putOperations.size());
-        assertEquals("Unexpected PATCH paths size", 68, patchOperations.size());
-        assertEquals("Unexpected DELETE paths size", 68, deleteOperations.size());
-    }
-
-    /**
-     * Test that checks for correct amount of parameters in requests.
-     */
-    @Test
-    @SuppressWarnings("checkstyle:lineLength")
-    public void testMountPointRecursiveParameters() throws Exception {
-        final var configPaths = Map.of("/rests/data/nodes/node=123/yang-ext:mount/recursive:container-root", 0,
-            "/rests/data/nodes/node=123/yang-ext:mount/recursive:container-root/root-list={name}", 1,
-            "/rests/data/nodes/node=123/yang-ext:mount/recursive:container-root/root-list={name}/nested-list={name1}", 2,
-            "/rests/data/nodes/node=123/yang-ext:mount/recursive:container-root/root-list={name}/nested-list={name1}/super-nested-list={name2}", 3);
-
-        final var mockInfo = DocGenTestHelper.createMockUriInfo(HTTP_URL);
-        openApi.onMountPointCreated(INSTANCE_ID);
-
-        final var mountPointApi = openApi.getMountPointApi(mockInfo, 1L, "recursive", "2023-05-22");
-        assertNotNull("Failed to find Datastore API", mountPointApi);
-
-        final var paths = mountPointApi.paths();
-        assertEquals(5, paths.size());
-
-        for (final var expectedPath : configPaths.entrySet()) {
-            assertTrue(paths.containsKey(expectedPath.getKey()));
-            final int expectedSize = expectedPath.getValue();
-
-            final var path = paths.get(expectedPath.getKey());
-
-            final var get = path.get();
-            assertNotNull(get);
-            assertEquals(expectedSize + 1, get.parameters().size());
-
-            final var put = path.put();
-            assertNotNull(put);
-            assertEquals(expectedSize, put.parameters().size());
-
-            final var delete = path.delete();
-            assertNotNull(delete);
-            assertEquals(expectedSize, delete.parameters().size());
-
-            final var patch = path.patch();
-            assertNotNull(patch);
-            assertEquals(expectedSize, patch.parameters().size());
-        }
-
-        // POST request exists only for containers
-        final var post = paths.get("/rests/data/nodes/node=123/yang-ext:mount/recursive:container-root").post();
-        assertNotNull(post);
-        final int expectedSize = configPaths.get("/rests/data/nodes/node=123/yang-ext:mount/recursive:container-root");
-        assertEquals(expectedSize, post.parameters().size());
-    }
-
-    /**
-     * Test that request parameters are correctly numbered.
-     *
-     * <p>
-     * It means we should have name and name1, etc. when we have the same parameter in path multiple times.
-     */
-    @Test
-    public void testParametersNumberingForMountPointApi() throws Exception {
-        final UriInfo mockInfo = DocGenTestHelper.createMockUriInfo(HTTP_URL);
-        openApi.onMountPointCreated(INSTANCE_ID);
-
-        final OpenApiObject mountPointApi = openApi.getMountPointApi(mockInfo, 1L, null);
-        assertNotNull("Failed to find Datastore API", mountPointApi);
-
-        var pathToList1 = "/rests/data/nodes/node=123/yang-ext:mount/path-params-test:cont/list1={name}";
-        assertTrue(mountPointApi.paths().containsKey(pathToList1));
-        assertEquals(List.of("name"), getPathGetParameters(mountPointApi.paths(), pathToList1));
-
-        var pathToList2 = "/rests/data/nodes/node=123/yang-ext:mount/path-params-test:cont/list1={name}/list2={name1}";
-        assertTrue(mountPointApi.paths().containsKey(pathToList2));
-        assertEquals(List.of("name", "name1"), getPathGetParameters(mountPointApi.paths(), pathToList2));
-
-        var pathToList3 = "/rests/data/nodes/node=123/yang-ext:mount/path-params-test:cont/list3={name}";
-        assertTrue(mountPointApi.paths().containsKey(pathToList3));
-        assertEquals(List.of("name"), getPathGetParameters(mountPointApi.paths(), pathToList3));
-
-        var pathToList4 = "/rests/data/nodes/node=123/yang-ext:mount/path-params-test:cont/list1={name}/list4={name1}";
-        assertTrue(mountPointApi.paths().containsKey(pathToList4));
-        assertEquals(List.of("name", "name1"), getPathGetParameters(mountPointApi.paths(), pathToList4));
-
-        var pathToList5 = "/rests/data/nodes/node=123/yang-ext:mount/path-params-test:cont/list1={name}/cont2";
-        assertTrue(mountPointApi.paths().containsKey(pathToList5));
-        assertEquals(List.of("name"), getPathGetParameters(mountPointApi.paths(), pathToList5));
-    }
-
-    /**
-     * Test that request parameters are correctly typed.
-     */
-    @Test
-    public void testParametersTypesForMountPointApi() throws Exception {
-        final var mockInfo = DocGenTestHelper.createMockUriInfo(HTTP_URL);
-        openApi.onMountPointCreated(INSTANCE_ID);
-        final var doc = openApi.getMountPointApi(mockInfo, 1L, null);
-        final var pathToContainer = "/rests/data/nodes/node=123/yang-ext:mount/typed-params:typed/";
-        final var integerTypes = List.of("uint64", "uint32", "uint16", "uint8", "int64", "int32", "int16", "int8");
-        for (final var type: integerTypes) {
-            final var typeKey = type + "-key";
-            final var path = pathToContainer + type + "={" + typeKey + "}";
-            assertTrue(doc.paths().containsKey(path));
-            assertEquals("integer", doc.paths().get(path).get().parameters().get(0).schema().type());
-        }
-    }
-
-    /**
-     * Test that request for actions is correct and has parameters.
-     */
-    @Test
-    public void testActionPathsParamsForMountPointApi() throws Exception {
-        final var mockInfo = DocGenTestHelper.createMockUriInfo(HTTP_URL);
-        openApi.onMountPointCreated(INSTANCE_ID);
-
-        final var mountPointApi = openApi.getMountPointApi(mockInfo, 1L, null);
-        assertNotNull("Failed to find Datastore API", mountPointApi);
-
-        final var pathWithParameters =
-            "/rests/operations/nodes/node=123/yang-ext:mount/action-types:list={name}/list-action";
-        assertTrue(mountPointApi.paths().containsKey(pathWithParameters));
-        assertEquals(List.of("name"), getPathPostParameters(mountPointApi.paths(), pathWithParameters));
-
-        final var pathWithoutParameters =
-            "/rests/operations/nodes/node=123/yang-ext:mount/action-types:multi-container/inner-container/action";
-        assertTrue(mountPointApi.paths().containsKey(pathWithoutParameters));
-        assertEquals(List.of(), getPathPostParameters(mountPointApi.paths(), pathWithoutParameters));
-    }
-
-    /**
-     * Test that checks if securitySchemes and security elements are present.
-     */
-    @Test
-    public void testAuthenticationFeature() throws Exception {
-        final var mockInfo = DocGenTestHelper.createMockUriInfo(HTTP_URL);
-        openApi.onMountPointCreated(INSTANCE_ID);
-        final var mountPointApi = openApi.getMountPointApi(mockInfo, 1L, null);
-
-        assertEquals("[{basicAuth=[]}]", mountPointApi.security().toString());
-        assertEquals("Http[type=http, scheme=basic, description=null, bearerFormat=null]",
-            mountPointApi.components().securitySchemes().get(BASIC_AUTH_NAME).toString());
-    }
-
-    @Test
-    public void testSummaryForAllModules() {
-        openApi.onMountPointCreated(INSTANCE_ID);
-        // get OpenApiObject for the device (all modules)
-        final OpenApiObject openApiAll = openApi.getMountPointApi(uriDeviceAll, DEVICE_ID, null);
-        final String getToasterSummary = openApiAll.paths()
-            .get(TOASTER_NODE_PATH)
-            .get()
-            .summary();
-        assertEquals(TOASTER_NODE_GET_SUMMARY, getToasterSummary);
-    }
-
-    @Test
-    public void testSummaryForSingleModule() {
-        openApi.onMountPointCreated(INSTANCE_ID);
-        // get OpenApiObject for a specific module (toaster) associated with the mounted device
-        final OpenApiObject openApiToaster = openApi.getMountPointApi(uriDeviceToaster, DEVICE_ID, TOASTER,
-            TOASTER_REVISION);
-        final String getToasterSummary = openApiToaster.paths()
-            .get(TOASTER_NODE_PATH)
-            .get()
-            .summary();
-        assertEquals(TOASTER_NODE_GET_SUMMARY, getToasterSummary);
-    }
-
-    @Test
-    public void testPathsForSpecificModuleOfMounted() {
-        openApi.onMountPointCreated(INSTANCE_ID);
-
-        // get OpenApiObject for the device (all modules)
-        final OpenApiObject openApiAll = openApi.getMountPointApi(uriDeviceAll, DEVICE_ID, null);
-        // get OpenApiObject for a specific module (toaster(2009-11-20))
-        final OpenApiObject openApiToaster = openApi.getMountPointApi(uriDeviceToaster, DEVICE_ID, TOASTER,
-            TOASTER_REVISION);
-
-        /*
-            filter paths from openapi for all modules down to only those that are present in openapi for toaster.
-            The Path object for the path, that in this case ends with "yang-ext:mount" is constructed in a different way
-            when requesting OpenApiObject for a single module compared to requesting it for all modules.
-            We do not want to include it in this particular comparison, so filter it out
-         */
-        final Set<Map.Entry<String, Path>> toasterPathsFromAll = openApiAll.paths().entrySet()
-            .stream()
-            .filter(e -> openApiToaster.paths().containsKey(e.getKey()) && !e.getKey().endsWith("yang-ext:mount"))
-            .collect(Collectors.toSet());
-
-        final Set<Map.Entry<String, Path>> toasterPathsFromToaster = openApiToaster.paths().entrySet()
-            .stream()
-            .filter(e -> !e.getKey().endsWith("yang-ext:mount"))
-            .collect(Collectors.toSet());
-
-        // verify that the filtered set (from openapi for all modules) is the same as the set from openapi for toaster
-        assertEquals(toasterPathsFromToaster, toasterPathsFromAll);
-    }
-
-    /**
-     * Test that checks if namespace for rpc is present.
-     */
-    @Test
-    public void testRpcNamespace() throws Exception {
-        final var mockInfo = DocGenTestHelper.createMockUriInfo(HTTP_URL);
-        openApi.onMountPointCreated(INSTANCE_ID);
-
-        final var mountPointApi = openApi.getMountPointApi(mockInfo, 1L, null);
-        assertNotNull("Failed to find Datastore API", mountPointApi);
-        final var paths = mountPointApi.paths();
-        final var path = paths.get("/rests/operations/nodes/node=123/yang-ext:mount/toaster:cancel-toast");
-        assertNotNull(path);
-        final var content = path.post().requestBody().content().get("application/xml");
-        assertNotNull(content);
-        final var schema = content.schema();
-        assertNotNull(schema);
-        final var xml = schema.xml();
-        assertNotNull(xml);
-        final var namespace = xml.namespace();
-        assertNotNull(namespace);
-        assertEquals("http://netconfcentral.org/ns/toaster", namespace);
-    }
-
-    /**
-     * Test that checks if namespace for actions is present.
-     */
-    @Test
-    public void testActionsNamespace() throws Exception {
-        final var mockInfo = DocGenTestHelper.createMockUriInfo(HTTP_URL);
-        openApi.onMountPointCreated(INSTANCE_ID);
-        final var mountPointApi = openApi.getMountPointApi(mockInfo, 1L, null);
-        assertNotNull("Failed to find Datastore API", mountPointApi);
-        final var paths = mountPointApi.paths();
-        final var path = paths.get(
-            "/rests/operations/nodes/node=123/yang-ext:mount/action-types:multi-container/inner-container/action");
-        assertNotNull(path);
-        final var content = path.post().requestBody().content().get("application/xml");
-        assertNotNull(content);
-        final var schema = content.schema();
-        assertNotNull(schema);
-        final var xml = schema.xml();
-        assertNotNull(xml);
-        final var namespace = xml.namespace();
-        assertNotNull(namespace);
-        assertEquals("urn:ietf:params:xml:ns:yang:test:action:types", namespace);
-    }
-
-    /**
-     * Test that number of elements in payload is correct.
-     */
-    @SuppressWarnings("unchecked")
-    @Test
-    public void testLeafListWithMinElementsPayloadOnMountPoint() throws Exception {
-        final var mockInfo = DocGenTestHelper.createMockUriInfo(HTTP_URL);
-        openApi.onMountPointCreated(INSTANCE_ID);
-        final var mountPointApi = openApi.getMountPointApi(mockInfo, 1L, null);
-        assertNotNull(mountPointApi);
-        final var paths = mountPointApi.paths();
-        final var path =
-            paths.get("/rests/data/nodes/node=123/yang-ext:mount/mandatory-test:root-container/mandatory-container");
-        assertNotNull(path);
-        final var requestBody = path.put().requestBody().content();
-        assertNotNull(requestBody);
-        final var jsonRef = requestBody.get("application/json").schema().properties()
-            .get("mandatory-test:mandatory-container").ref();
-        assertNotNull(jsonRef);
-        final var xmlRef = requestBody.get("application/xml").schema().ref();
-        assertNotNull(xmlRef);
-        final var schema =
-            mountPointApi.components().schemas().get("mandatory-test_root-container_mandatory-container");
-        assertNotNull(schema);
-        final var minItems = schema.properties().get("leaf-list-with-min-elements").minItems();
-        assertNotNull(minItems);
-        final var listOfExamples = ((List<String>) schema.properties().get("leaf-list-with-min-elements").example());
-        assertNotNull(listOfExamples);
-        assertEquals(jsonRef, xmlRef);
-        assertEquals(listOfExamples.size(), minItems.intValue());
-    }
-}
index 782f40edc734db9c41e7ff6864132d9b1ae1e86e..9c4acbfecd4e20af9ed4158683151d689ec391a9 100644 (file)
@@ -3,7 +3,7 @@
   "info": {
     "version": "1.0.0",
     "title": "action-types",
-    "description": "We are providing full API for configurational data which can be edited (by POST, PUT, PATCH and DELETE).\nFor operational data we only provide GET API.\n\nFor majority of request you can see only config data in examples. Thats because we can show only one example\nper request. The exception when you can see operational data in example is when data are representing\noperational (config false) container with no config data in it."
+    "description": "We are providing full API for configurational data which can be edited (by POST, PUT, PATCH and DELETE).\nFor operational data we only provide GET API.\n\nFor majority of request you can see only config data in examples. That is because we can show only one example\nper request. The exception when you can see operational data in example is when data are representing\noperational (config false) container with no config data in it."
   },
   "servers": [
     {
index 2aa4934aaa85d0a41eda521dbacd797cebbdc898..1fcbdd7c5a5aadd70fa08ac54c4f83139775321f 100644 (file)
@@ -3,7 +3,7 @@
   "info": {
     "version": "1.0.0",
     "title": "Controller modules of RESTCONF",
-    "description": "We are providing full API for configurational data which can be edited (by POST, PUT, PATCH and DELETE).\nFor operational data we only provide GET API.\n\nFor majority of request you can see only config data in examples. Thats because we can show only one example\nper request. The exception when you can see operational data in example is when data are representing\noperational (config false) container with no config data in it."
+    "description": "We are providing full API for configurational data which can be edited (by POST, PUT, PATCH and DELETE).\nFor operational data we only provide GET API.\n\nFor majority of request you can see only config data in examples. That is because we can show only one example\nper request. The exception when you can see operational data in example is when data are representing\noperational (config false) container with no config data in it."
   },
   "servers": [
     {
index 0e6d7547ad888cda269ceb1c5e94a9e4956dca62..005dc76ccc8ad07180b4248f454728fee92e1cdf 100644 (file)
@@ -3,7 +3,7 @@
   "info": {
     "version": "1.0.0",
     "title": "operational",
-    "description": "We are providing full API for configurational data which can be edited (by POST, PUT, PATCH and DELETE).\nFor operational data we only provide GET API.\n\nFor majority of request you can see only config data in examples. Thats because we can show only one example\nper request. The exception when you can see operational data in example is when data are representing\noperational (config false) container with no config data in it."
+    "description": "We are providing full API for configurational data which can be edited (by POST, PUT, PATCH and DELETE).\nFor operational data we only provide GET API.\n\nFor majority of request you can see only config data in examples. That is because we can show only one example\nper request. The exception when you can see operational data in example is when data are representing\noperational (config false) container with no config data in it."
   },
   "servers": [
     {
index d65ed4618520af444fa5f5730ae02793975aa087..1c4540f0f3983606797514fe3050d17717027ff3 100644 (file)
@@ -3,7 +3,7 @@
   "info": {
     "version": "1.0.0",
     "title": "action-types",
-    "description": "We are providing full API for configurational data which can be edited (by POST, PUT, PATCH and DELETE).\nFor operational data we only provide GET API.\n\nFor majority of request you can see only config data in examples. Thats because we can show only one example\nper request. The exception when you can see operational data in example is when data are representing\noperational (config false) container with no config data in it."
+    "description": "We are providing full API for configurational data which can be edited (by POST, PUT, PATCH and DELETE).\nFor operational data we only provide GET API.\n\nFor majority of request you can see only config data in examples. That is because we can show only one example\nper request. The exception when you can see operational data in example is when data are representing\noperational (config false) container with no config data in it."
   },
   "servers": [
     {
index ee5daa236ef83c154eb9ae48ccbd618100995b14..c49e62647b3e612ffef0ee8e3840e1fdc97d3d56 100644 (file)
@@ -3,7 +3,7 @@
   "info": {
     "version": "1.0.0",
     "title": "123 modules of RESTCONF",
-    "description": "We are providing full API for configurational data which can be edited (by POST, PUT, PATCH and DELETE).\nFor operational data we only provide GET API.\n\nFor majority of request you can see only config data in examples. Thats because we can show only one example\nper request. The exception when you can see operational data in example is when data are representing\noperational (config false) container with no config data in it."
+    "description": "We are providing full API for configurational data which can be edited (by POST, PUT, PATCH and DELETE).\nFor operational data we only provide GET API.\n\nFor majority of request you can see only config data in examples. That is because we can show only one example\nper request. The exception when you can see operational data in example is when data are representing\noperational (config false) container with no config data in it."
   },
   "servers": [
     {
index fab4fc05df0fc59d1b2c7f97087952704b7defff..9240611765fd1472cd77cf66caca841738d3e24a 100644 (file)
@@ -3,7 +3,7 @@
   "info": {
     "version": "1.0.0",
     "title": "operational",
-    "description": "We are providing full API for configurational data which can be edited (by POST, PUT, PATCH and DELETE).\nFor operational data we only provide GET API.\n\nFor majority of request you can see only config data in examples. Thats because we can show only one example\nper request. The exception when you can see operational data in example is when data are representing\noperational (config false) container with no config data in it."
+    "description": "We are providing full API for configurational data which can be edited (by POST, PUT, PATCH and DELETE).\nFor operational data we only provide GET API.\n\nFor majority of request you can see only config data in examples. That is because we can show only one example\nper request. The exception when you can see operational data in example is when data are representing\noperational (config false) container with no config data in it."
   },
   "servers": [
     {
diff --git a/restconf/restconf-openapi/src/test/resources/sample-swagger-spec.json b/restconf/restconf-openapi/src/test/resources/sample-swagger-spec.json
deleted file mode 100644 (file)
index 2d1b09a..0000000
+++ /dev/null
@@ -1,440 +0,0 @@
-{
-    "apiVersion": "1.0.0",
-    "swaggerVersion": "1.2",
-    "basePath": "/api",
-    "resourcePath": "/pet",
-    "produces": [
-        "application/json",
-        "application/xml",
-        "text/plain",
-        "text/html"
-    ],
-    "authorizations": {
-        "oauth2": [
-            {
-                "scope": "write:pets",
-                "description": "modify pets in your account"
-            },
-            {
-                "scope": "read:pets",
-                "description": "read your pets"
-            }
-        ]
-    },
-    "apis": [
-        {
-            "path": "/pet",
-            "operations": [
-                {
-                    "method": "POST",
-                    "summary": "Add a new pet to the store",
-                    "notes": "",
-                    "type": "void",
-                    "nickname": "addPet",
-                    "consumes": [
-                        "application/json",
-                        "application/xml"
-                    ],
-                    "authorizations": {
-                        "oauth2": [
-                            {
-                                "scope": "write:pets",
-                                "description": "modify pets in your account"
-                            }
-                        ]
-                    },
-                    "parameters": [
-                        {
-                            "name": "body",
-                            "description": "Pet object that needs to be added to the store",
-                            "required": true,
-                            "type": "Pet",
-                            "paramType": "body"
-                        }
-                    ],
-                    "responseMessages": [
-                        {
-                            "code": 405,
-                            "message": "Invalid input"
-                        }
-                    ]
-                },
-                {
-                    "method": "PUT",
-                    "summary": "Update an existing pet",
-                    "notes": "",
-                    "type": "void",
-                    "nickname": "updatePet",
-                    "authorizations": {},
-                    "parameters": [
-                        {
-                            "name": "body",
-                            "description": "Pet object that needs to be updated in the store",
-                            "required": true,
-                            "type": "Pet",
-                            "paramType": "body"
-                        }
-                    ],
-                    "responseMessages": [
-                        {
-                            "code": 400,
-                            "message": "Invalid ID supplied"
-                        },
-                        {
-                            "code": 404,
-                            "message": "Pet not found"
-                        },
-                        {
-                            "code": 405,
-                            "message": "Validation exception"
-                        }
-                    ]
-                }
-            ]
-        },
-        {
-            "path": "/pet/findByStatus",
-            "operations": [
-                {
-                    "method": "GET",
-                    "summary": "Finds Pets by status",
-                    "notes": "<strong>Multiple status values can be provided with comma seperated strings</strong>",
-                    "type": "array",
-                    "items": {
-                        "$ref": "Pet"
-                    },
-                    "nickname": "testNodeType",
-                    "authorizations": {},
-                    "parameters": [
-                        {
-                            "name": "nodeTypez",
-                            "description": "Status values that need to be considered for filter",
-                            "defaultValue": "available",
-                            "required": true,
-                            "type": "string",
-                            "paramType": "query",
-                            "enum": [
-                                "available",
-                                "pending",
-                                "sold"
-                            ]
-                        }
-                    ],
-                    "responseMessages": [
-                        {
-                            "code": 400,
-                            "message": "Invalid status value"
-                        }
-                    ]
-                }
-            ]
-        },
-        {
-            "path": "/pet/findByTags",
-            "operations": [
-                {
-                    "method": "GET",
-                    "summary": "Finds Pets by tags",
-                    "notes": "Muliple tags can be provided with comma seperated strings. Use tag1, tag2, tag3 for testing.",
-                    "type": "array",
-                    "items": {
-                        "$ref": "Pet"
-                    },
-                    "nickname": "findPetsByTags",
-                    "authorizations": {},
-                    "parameters": [
-                        {
-                            "name": "tags",
-                            "description": "Tags to filter by",
-                            "required": true,
-                            "type": "string",
-                            "paramType": "query"
-                        }
-                    ],
-                    "responseMessages": [
-                        {
-                            "code": 400,
-                            "message": "Invalid tag value"
-                        }
-                    ],
-                    "deprecated": "true"
-                }
-            ]
-        },
-        {
-            "path": "/pet/{petId}",
-            "operations": [
-                {
-                    "method": "PATCH",
-                    "summary": "partial updates to a pet",
-                    "notes": "",
-                    "type": "array",
-                    "items": {
-                        "$ref": "Pet"
-                    },
-                    "nickname": "partialUpdate",
-                    "produces": [
-                        "application/json",
-                        "application/xml"
-                    ],
-                    "consumes": [
-                        "application/json",
-                        "application/xml"
-                    ],
-                    "authorizations": {
-                        "oauth2": [
-                            {
-                                "scope": "write:pets",
-                                "description": "modify pets in your account"
-                            }
-                        ]
-                    },
-                    "parameters": [
-                        {
-                            "name": "petId",
-                            "description": "ID of pet that needs to be fetched",
-                            "required": true,
-                            "type": "string",
-                            "paramType": "path"
-                        },
-                        {
-                            "name": "body",
-                            "description": "Pet object that needs to be added to the store",
-                            "required": true,
-                            "type": "Pet",
-                            "paramType": "body"
-                        }
-                    ],
-                    "responseMessages": [
-                        {
-                            "code": 400,
-                            "message": "Invalid tag value"
-                        }
-                    ]
-                },
-                {
-                    "method": "POST",
-                    "summary": "Updates a pet in the store with form data",
-                    "notes": "",
-                    "type": "void",
-                    "nickname": "updatePetWithForm",
-                    "consumes": [
-                        "application/x-www-form-urlencoded"
-                    ],
-                    "authorizations": {
-                        "oauth2": [
-                            {
-                                "scope": "write:pets",
-                                "description": "modify pets in your account"
-                            }
-                        ]
-                    },
-                    "parameters": [
-                        {
-                            "name": "petId",
-                            "description": "ID of pet that needs to be updated",
-                            "required": true,
-                            "type": "string",
-                            "paramType": "path"
-                        },
-                        {
-                            "name": "name",
-                            "description": "Updated name of the pet",
-                            "required": false,
-                            "type": "string",
-                            "paramType": "form"
-                        },
-                        {
-                            "name": "status",
-                            "description": "Updated status of the pet",
-                            "required": false,
-                            "type": "string",
-                            "paramType": "form"
-                        }
-                    ],
-                    "responseMessages": [
-                        {
-                            "code": 405,
-                            "message": "Invalid input"
-                        }
-                    ]
-                },
-                {
-                    "method": "DELETE",
-                    "summary": "Deletes a pet",
-                    "notes": "",
-                    "type": "void",
-                    "nickname": "deletePet",
-                    "authorizations": {
-                        "oauth2": [
-                            {
-                                "scope": "write:pets",
-                                "description": "modify pets in your account"
-                            }
-                        ]
-                    },
-                    "parameters": [
-                        {
-                            "name": "petId",
-                            "description": "Pet id to delete",
-                            "required": true,
-                            "type": "string",
-                            "paramType": "path"
-                        }
-                    ],
-                    "responseMessages": [
-                        {
-                            "code": 400,
-                            "message": "Invalid pet value"
-                        }
-                    ]
-                },
-                {
-                    "method": "GET",
-                    "summary": "Find pet by ID",
-                    "notes": "Returns a pet based on ID",
-                    "type": "Pet",
-                    "nickname": "getPetById",
-                    "authorizations": {},
-                    "parameters": [
-                        {
-                            "name": "petId",
-                            "description": "ID of pet that needs to be fetched",
-                            "required": true,
-                            "type": "integer",
-                            "format": "int64",
-                            "paramType": "path",
-                            "minimum": "1.0",
-                            "maximum": "100000.0"
-                        }
-                    ],
-                    "responseMessages": [
-                        {
-                            "code": 400,
-                            "message": "Invalid ID supplied"
-                        },
-                        {
-                            "code": 404,
-                            "message": "Pet not found"
-                        }
-                    ]
-                }
-            ]
-        },
-        {
-            "path": "/pet/uploadImage",
-            "operations": [
-                {
-                    "method": "POST",
-                    "summary": "uploads an image",
-                    "notes": "",
-                    "type": "void",
-                    "nickname": "uploadFile",
-                    "consumes": [
-                        "multipart/form-data"
-                    ],
-                    "authorizations": {
-                        "oauth2": [
-                            {
-                                "scope": "write:pets",
-                                "description": "modify pets in your account"
-                            },
-                            {
-                                "scope": "read:pets",
-                                "description": "read your pets"
-                            }
-                        ]
-                    },
-                    "parameters": [
-                        {
-                            "name": "additionalMetadata",
-                            "description": "Additional data to pass to server",
-                            "required": false,
-                            "type": "string",
-                            "paramType": "form"
-                        },
-                        {
-                            "name": "file",
-                            "description": "file to upload",
-                            "required": false,
-                            "type": "File",
-                            "paramType": "body"
-                        }
-                    ]
-                }
-            ]
-        }
-    ],
-    "models": {
-        "Tag": {
-            "id": "Tag",
-            "properties": {
-                "id": {
-                    "type": "integer",
-                    "format": "int64"
-                },
-                "name": {
-                    "type": "string"
-                }
-            }
-        },
-        "Pet": {
-            "id": "Pet",
-            "required": [
-                "id",
-                "name"
-            ],
-            "properties": {
-                "id": {
-                    "type": "integer",
-                    "format": "int64",
-                    "description": "unique identifier for the pet",
-                    "minimum": "0.0",
-                    "maximum": "100.0"
-                },
-                "category": {
-                    "$ref": "Category"
-                },
-                "name": {
-                    "type": "string"
-                },
-                "photoUrls": {
-                    "type": "array",
-                    "items": {
-                        "type": "string"
-                    }
-                },
-                "tags": {
-                    "type": "array",
-                    "items": {
-                        "$ref": "Tag"
-                    }
-                },
-                "status": {
-                    "type": "string",
-                    "description": "pet status in the store",
-                    "enum": [
-                        "available",
-                        "pending",
-                        "sold"
-                    ]
-                }
-            }
-        },
-        "Category": {
-            "id": "Category",
-            "properties": {
-                "id": {
-                    "type": "integer",
-                    "format": "int64"
-                },
-                "name": {
-                    "type": "string"
-                },
-                "pet": {
-                    "$ref": "Pet"
-                }
-            }
-        }
-    }
-}
index a9ed89d1bb193c7e145b09e15837188caca272a6..93eeb9ea2e66420135c169c652f9cca137559331 100644 (file)
@@ -3,7 +3,7 @@
   "info": {
     "version": "1.0.0",
     "title": "Controller modules of RESTCONF",
-    "description": "We are providing full API for configurational data which can be edited (by POST, PUT, PATCH and DELETE).\nFor operational data we only provide GET API.\n\nFor majority of request you can see only config data in examples. Thats because we can show only one example\nper request. The exception when you can see operational data in example is when data are representing\noperational (config false) container with no config data in it."
+    "description": "We are providing full API for configurational data which can be edited (by POST, PUT, PATCH and DELETE).\nFor operational data we only provide GET API.\n\nFor majority of request you can see only config data in examples. That is because we can show only one example\nper request. The exception when you can see operational data in example is when data are representing\noperational (config false) container with no config data in it."
   },
   "servers": [
     {
index 4268396cccef0316cb9261837a937ed7ba1733b5..ccd5b680e00e18299d7a8e9d0a469aa1b1e956dd 100644 (file)
@@ -3,7 +3,7 @@
   "info": {
     "version": "1.0.0",
     "title": "toaster",
-    "description": "We are providing full API for configurational data which can be edited (by POST, PUT, PATCH and DELETE).\nFor operational data we only provide GET API.\n\nFor majority of request you can see only config data in examples. Thats because we can show only one example\nper request. The exception when you can see operational data in example is when data are representing\noperational (config false) container with no config data in it."
+    "description": "We are providing full API for configurational data which can be edited (by POST, PUT, PATCH and DELETE).\nFor operational data we only provide GET API.\n\nFor majority of request you can see only config data in examples. That is because we can show only one example\nper request. The exception when you can see operational data in example is when data are representing\noperational (config false) container with no config data in it."
   },
   "servers": [
     {
index f8a2834ebd6b3031cd2e33808835f9163c2b0040..fd068d46f882f12c4144c149f38c9a6e20c62150 100644 (file)
@@ -3,7 +3,7 @@
   "info": {
     "version": "1.0.0",
     "title": "123 modules of RESTCONF",
-    "description": "We are providing full API for configurational data which can be edited (by POST, PUT, PATCH and DELETE).\nFor operational data we only provide GET API.\n\nFor majority of request you can see only config data in examples. Thats because we can show only one example\nper request. The exception when you can see operational data in example is when data are representing\noperational (config false) container with no config data in it."
+    "description": "We are providing full API for configurational data which can be edited (by POST, PUT, PATCH and DELETE).\nFor operational data we only provide GET API.\n\nFor majority of request you can see only config data in examples. That is because we can show only one example\nper request. The exception when you can see operational data in example is when data are representing\noperational (config false) container with no config data in it."
   },
   "servers": [
     {
index 011d7bfc6da2a6d259cd947f7f2c1ef1e6651ffd..162ce26390743f85150007577004af0ae4f2b5f7 100644 (file)
@@ -3,7 +3,7 @@
   "info": {
     "version": "1.0.0",
     "title": "toaster",
-    "description": "We are providing full API for configurational data which can be edited (by POST, PUT, PATCH and DELETE).\nFor operational data we only provide GET API.\n\nFor majority of request you can see only config data in examples. Thats because we can show only one example\nper request. The exception when you can see operational data in example is when data are representing\noperational (config false) container with no config data in it."
+    "description": "We are providing full API for configurational data which can be edited (by POST, PUT, PATCH and DELETE).\nFor operational data we only provide GET API.\n\nFor majority of request you can see only config data in examples. That is because we can show only one example\nper request. The exception when you can see operational data in example is when data are representing\noperational (config false) container with no config data in it."
   },
   "servers": [
     {
diff --git a/restconf/restconf-openapi/src/test/resources/toaster.json b/restconf/restconf-openapi/src/test/resources/toaster.json
deleted file mode 100644 (file)
index 8af2462..0000000
+++ /dev/null
@@ -1,167 +0,0 @@
-{
-  "apiVersion": "1.0.0",
-  "swaggerVersion": "1.2",
-  "basePath": "/api",
-  "resourcePath": "/toaster",
-  "produces": [
-    "application/json",
-    "application/xml",
-    "text/plain",
-    "text/html"
-  ],
-  "apis": [
-    {
-      "path": "/toaster",
-      "operations": [
-        {
-          "method": "POST",
-          "summary": "Add a new toaster",
-          "notes": "",
-          "type": "void",
-          "nickname": "add toaster",
-          "consumes": [
-            "application/json",
-            "application/xml"
-          ],          
-          "parameters": [
-            {
-              "name": "body",
-              "description": "Pet object that needs to be added to the store",
-              "required": true,
-              "type": "Toaster",
-              "paramType": "body"
-            }
-          ],
-          "responseMessages": [
-            {
-              "code": 405,
-              "message": "Invalid input"
-            }
-          ]
-        }
-      ]
-     },
-    {
-      "path": "/toaster",
-      "operations": [
-        {
-          "method": "GET",
-          "summary": "Add a new toaster",
-          "notes": "",
-          "type": "Toaster",
-          "nickname": "Get toaster",
-          "consumes": [
-            "application/json",
-            "application/xml"
-          ],          
-          "responseMessages": [
-            {
-              "code": 405,
-              "message": "Invalid input"
-            }
-          ]
-        }
-      ]
-     },
-       {
-           "path" : "operations/toaster/cancel-toast",
-           "operations" : [ {
-             "method" : "POST",
-             "summary" : null,
-             "notes" : "Stop making toast, if any is being made.\n           A 'resource-denied' error will be returned \n           if the toaster service is disabled.",
-             "type" : null,
-             "nickname" : "cancel-toast",
-             "consumes" : null,
-             "parameters" : null,
-             "responseMessages" : null
-           } ]
-         }, {
-           "path" : "operations/toaster/make-toast",
-           "operations" : [ {
-             "method" : "POST",
-             "summary" : null,
-             "notes" : "Make some toast.\n           The toastDone notification will be sent when \n           the toast is finished.\n           An 'in-use' error will be returned if toast\n           is already being made.\n           A 'resource-denied' error will be returned \n           if the toaster service is disabled.",
-             "type" : null,
-             "nickname" : "make-toast",
-             "consumes" : null,
-             "parameters" : null,
-             "responseMessages" : null
-           } ]
-         }
-  ],
-  "models": {
-    "Toaster": {
-    "id":"Toaster",
-               "$schema": "http://json-schema.org/draft-04/schema",
-         "description": "Top-level container for all toaster database objects.",
-         "properties": {
-           "allow-user": {
-             "description": "A list of user name patterns to allow",
-             "items": {"type": "string"},
-             "required": false,
-             "type": "array"
-           },
-                "how": {
-             "oneOf": [
-               {
-                 "manual": {"manual": {
-                   "required": false,
-                   "type": "string"
-                 }},
-                 "type": "object"
-               },
-               {
-                 "interval": {"interval": {
-                   "required": false,
-                   "type": "integer"
-                 }},
-                 "type": "object"
-               },
-               {
-                 "daily": {
-                   "daily": {
-                     "required": false,
-                     "type": "string"
-                   },
-                   "time-of-day": {
-                     "required": false,
-                     "type": "string"
-                   }
-                 },
-                 "type": "object"
-               }
-             ],
-             "type": "object"
-           },
-           "testToasterBits": {
-             "enum": [
-               "testbit1",
-               "testbit2"
-             ],
-             "minItems": 0,
-             "required": false,
-             "type": "String",
-             "uniqueItems": true
-           },
-           "toasterManufacturer": {
-             "description": "The name of the toaster's manufacturer. For instance, \n                Microsoft Toaster.",
-             "required": true,
-             "type": "string"
-           },
-           "toasterModelNumber": {
-             "description": "The name of the toaster's model. For instance,\n               Radiant Automatic.",
-             "required": true,
-             "type": "string"
-           },
-           "toasterStatus": {
-             "description": "This variable indicates the current state of \n               the toaster.",
-             "enum": [
-               "up",
-               "down"
-             ],
-             "required": true
-           }
-         }     
-    }
-  }
-}
diff --git a/restconf/restconf-openapi/src/test/resources/topology-good.json b/restconf/restconf-openapi/src/test/resources/topology-good.json
deleted file mode 100644 (file)
index 4017829..0000000
+++ /dev/null
@@ -1,106 +0,0 @@
-{
-    "apiVersion": "1.0.0",
-    "swaggerVersion": "1.2",
-    "basePath": "/api",
-    "resourcePath": "/config",
-    "produces": [ "application/json", "application/xml" ],
-    "apis": [
-        {
-            "path": "/network-topology:network-topology/network-topology",
-            "operations": [
-                {
-                    "method": "GET",
-                    "summary": "Test",
-                    "notes": "",
-                    "type": "Toaster",
-                    "nickname": "something",
-                    "consumes": [
-                        "application/json",
-                        "application/xml"
-                    ],
-                    "responseMessages": [
-                        {
-                            "code": 405,
-                            "message": "Invalid input"
-                        }
-                    ]
-                }
-            ]
-        }
-    ],
-    "models": {
-        "Toaster": {
-            "id":"Toaster",
-            "$schema": "http://json-schema.org/draft-04/schema",
-            "description": "Top-level container for all toaster database objects.",
-            "properties": {
-                "allow-user": {
-                    "description": "A list of user name patterns to allow",
-                    "items": {"type": "string"},
-                    "required": false,
-                    "type": "array"
-                },
-                "how": {
-                    "oneOf": [
-                        {
-                            "manual": {"manual": {
-                                "required": false,
-                                "type": "string"
-                            }},
-                            "type": "object"
-                        },
-                        {
-                            "interval": {"interval": {
-                                "required": false,
-                                "type": "integer"
-                            }},
-                            "type": "object"
-                        },
-                        {
-                            "daily": {
-                                "daily": {
-                                    "required": false,
-                                    "type": "string"
-                                },
-                                "time-of-day": {
-                                    "required": false,
-                                    "type": "string"
-                                }
-                            },
-                            "type": "object"
-                        }
-                    ],
-                    "type": "object"
-                },
-                "testToasterBits": {
-                    "enum": [
-                        "testbit1",
-                        "testbit2"
-                    ],
-                    "minItems": 0,
-                    "required": false,
-                    "type": "String",
-                    "uniqueItems": true
-                },
-                "toasterManufacturer": {
-                    "description": "The name of the toaster's manufacturer. For instance, \n                Microsoft Toaster.",
-                    "required": true,
-                    "type": "string"
-                },
-                "toasterModelNumber": {
-                    "description": "The name of the toaster's model. For instance,\n               Radiant Automatic.",
-                    "required": true,
-                    "type": "string"
-                },
-                "toasterStatus": {
-                    "description": "This variable indicates the current state of \n               the toaster.",
-                    "enum": [
-                        "up",
-                        "down"
-                    ],
-                    "required": true
-                }
-            }
-        }
-    }
-}
\ No newline at end of file
diff --git a/restconf/restconf-openapi/src/test/resources/topology-new.json b/restconf/restconf-openapi/src/test/resources/topology-new.json
deleted file mode 100644 (file)
index c34fd8f..0000000
+++ /dev/null
@@ -1,35 +0,0 @@
-{
-    "apiVersion": "1.0.0",
-    "swaggerVersion": "1.2",
-    "basePath": "/restconf",
-    "resourcePath": "/config",
-    "produces": [ "application/json", "application/xml" ],
-    "apis": [
-        {
-            "path": "/network-topology:network-topology/network-topology",
-            "operations": [
-                {
-                    "method": "GET",
-                    "summary": "Test",
-                    "notes": null,
-                    "type": "support",
-                    "nickname": "test",
-                    "consumes": null,
-                    "responseMessages": null
-                }
-            ]
-        }
-    ],
-    "models": {
-        "supporting-link": {
-            "id":"supporting-link",
-            "$schema": "http://json-schema.org/draft-04/schema",
-            "properties": {
-                "link-ref": {
-                    "required": false
-                }
-            },
-            "type": "object"
-        }
-    }
-}
\ No newline at end of file
diff --git a/restconf/restconf-openapi/src/test/resources/topology.json b/restconf/restconf-openapi/src/test/resources/topology.json
deleted file mode 100644 (file)
index 8a1a131..0000000
+++ /dev/null
@@ -1,730 +0,0 @@
-{
-    "apiVersion" : "1.0.0",
-    "swaggerVersion" : "1.2",
-    "basePath" : "http://10.195.128.107:8080/restconf",
-    "resourcePath" : null,
-    "produces" : [ "application/json", "application/xml" ],
-    "apis" : [ {
-        "path" : "/operational/network-topology:network-topology",
-        "operations" : [ {
-            "method" : "GET",
-            "summary" : null,
-            "notes" : null,
-            "type" : "network-topology",
-            "nickname" : "GET-network-topology",
-            "consumes" : null,
-            "parameters" : [ ],
-            "responseMessages" : null
-        } ]
-    }, {
-        "path" : "/operational/network-topology:network-topology/topology/{topology-id}",
-        "operations" : [ {
-            "method" : "GET",
-            "summary" : null,
-            "notes" : "\n                This is the model of an abstract topology.\n                A topology contins nodes and links.  \n                Each topology MUST be identified by\n                unique topology-id for reason that a network could contain many\n                topologies.\n            ",
-            "type" : "topology",
-            "nickname" : "GET-topology",
-            "consumes" : null,
-            "parameters" : [ {
-                "name" : "topology-id",
-                "description" : "\n                    It is presumed that a datastore will contain many topologies. To\n                    distinguish between topologies it is vital to have UNIQUE\n                    topology identifiers.\n                ",
-                "required" : false,
-                "type" : "string",
-                "paramType" : "path"
-            } ],
-            "responseMessages" : null
-        } ]
-    }, {
-        "path" : "/operational/network-topology:network-topology/topology/{topology-id}/link/{link-id}",
-        "operations" : [ {
-            "method" : "GET",
-            "summary" : null,
-            "notes" : "\n                    A Network Link connects a by Local (Source) node and\n                    a Remote (Destination) Network Nodes via a set of the \n                    nodes' termination points. \n                    As it is possible to have several links between the same\n                    source and destination nodes, and as a link could potentially\n                    be re-homed between termination points, to ensure that we \n                    would always know to distinguish between links, every link \n                    is identified by a dedicated link identifier.  \n                    Note that a link models a point-to-point link, not a multipoint\n                    link.  \n                    Layering dependencies on links in underlay topologies are\n                    not represented as the layering information of nodes and of \n                    termination points is sufficient.  \n                ",
-            "type" : "link",
-            "nickname" : "GET-link",
-            "consumes" : null,
-            "parameters" : [ {
-                "name" : "topology-id",
-                "description" : "\n                    It is presumed that a datastore will contain many topologies. To\n                    distinguish between topologies it is vital to have UNIQUE\n                    topology identifiers.\n                ",
-                "required" : false,
-                "type" : "string",
-                "paramType" : "path"
-            }, {
-                "name" : "link-id",
-                "description" : "The identifier of a link in the topology.  \n                A link is specific to a topology to which it belongs.",
-                "required" : false,
-                "type" : "string",
-                "paramType" : "path"
-            } ],
-            "responseMessages" : null
-        } ]
-    }, {
-        "path" : "/operational/network-topology:network-topology/topology/{topology-id}/link/{link-id}/destination",
-        "operations" : [ {
-            "method" : "GET",
-            "summary" : null,
-            "notes" : null,
-            "type" : "destination",
-            "nickname" : "GET-destination",
-            "consumes" : null,
-            "parameters" : [ {
-                "name" : "topology-id",
-                "description" : "\n                    It is presumed that a datastore will contain many topologies. To\n                    distinguish between topologies it is vital to have UNIQUE\n                    topology identifiers.\n                ",
-                "required" : false,
-                "type" : "string",
-                "paramType" : "path"
-            }, {
-                "name" : "link-id",
-                "description" : "The identifier of a link in the topology.  \n                A link is specific to a topology to which it belongs.",
-                "required" : false,
-                "type" : "string",
-                "paramType" : "path"
-            } ],
-            "responseMessages" : null
-        } ]
-    }, {
-        "path" : "/operational/network-topology:network-topology/topology/{topology-id}/link/{link-id}/destination/dest-node",
-        "operations" : [ {
-            "method" : "GET",
-            "summary" : null,
-            "notes" : "Destination node identifier, must be in same topology.",
-            "type" : "dest-node",
-            "nickname" : "GET-dest-node",
-            "consumes" : null,
-            "parameters" : [ {
-                "name" : "topology-id",
-                "description" : "\n                    It is presumed that a datastore will contain many topologies. To\n                    distinguish between topologies it is vital to have UNIQUE\n                    topology identifiers.\n                ",
-                "required" : false,
-                "type" : "string",
-                "paramType" : "path"
-            }, {
-                "name" : "link-id",
-                "description" : "The identifier of a link in the topology.  \n                A link is specific to a topology to which it belongs.",
-                "required" : false,
-                "type" : "string",
-                "paramType" : "path"
-            } ],
-            "responseMessages" : null
-        } ]
-    }, {
-        "path" : "/operational/network-topology:network-topology/topology/{topology-id}/link/{link-id}/destination/dest-tp",
-        "operations" : [ {
-            "method" : "GET",
-            "summary" : null,
-            "notes" : "Termination point within destination node that terminates the link.",
-            "type" : "dest-tp",
-            "nickname" : "GET-dest-tp",
-            "consumes" : null,
-            "parameters" : [ {
-                "name" : "topology-id",
-                "description" : "\n                    It is presumed that a datastore will contain many topologies. To\n                    distinguish between topologies it is vital to have UNIQUE\n                    topology identifiers.\n                ",
-                "required" : false,
-                "type" : "string",
-                "paramType" : "path"
-            }, {
-                "name" : "link-id",
-                "description" : "The identifier of a link in the topology.  \n                A link is specific to a topology to which it belongs.",
-                "required" : false,
-                "type" : "string",
-                "paramType" : "path"
-            } ],
-            "responseMessages" : null
-        } ]
-    }, {
-        "path" : "/operational/network-topology:network-topology/topology/{topology-id}/link/{link-id}/link-id",
-        "operations" : [ {
-            "method" : "GET",
-            "summary" : null,
-            "notes" : "The identifier of a link in the topology.  \n                A link is specific to a topology to which it belongs.",
-            "type" : "link-id",
-            "nickname" : "GET-link-id",
-            "consumes" : null,
-            "parameters" : [ {
-                "name" : "topology-id",
-                "description" : "\n                    It is presumed that a datastore will contain many topologies. To\n                    distinguish between topologies it is vital to have UNIQUE\n                    topology identifiers.\n                ",
-                "required" : false,
-                "type" : "string",
-                "paramType" : "path"
-            }, {
-                "name" : "link-id",
-                "description" : "The identifier of a link in the topology.  \n                A link is specific to a topology to which it belongs.",
-                "required" : false,
-                "type" : "string",
-                "paramType" : "path"
-            } ],
-            "responseMessages" : null
-        } ]
-    }, {
-        "path" : "/operational/network-topology:network-topology/topology/{topology-id}/link/{link-id}/source",
-        "operations" : [ {
-            "method" : "GET",
-            "summary" : null,
-            "notes" : null,
-            "type" : "source",
-            "nickname" : "GET-source",
-            "consumes" : null,
-            "parameters" : [ {
-                "name" : "topology-id",
-                "description" : "\n                    It is presumed that a datastore will contain many topologies. To\n                    distinguish between topologies it is vital to have UNIQUE\n                    topology identifiers.\n                ",
-                "required" : false,
-                "type" : "string",
-                "paramType" : "path"
-            }, {
-                "name" : "link-id",
-                "description" : "The identifier of a link in the topology.  \n                A link is specific to a topology to which it belongs.",
-                "required" : false,
-                "type" : "string",
-                "paramType" : "path"
-            } ],
-            "responseMessages" : null
-        } ]
-    }, {
-        "path" : "/operational/network-topology:network-topology/topology/{topology-id}/link/{link-id}/source/source-node",
-        "operations" : [ {
-            "method" : "GET",
-            "summary" : null,
-            "notes" : "Source node identifier, must be in same topology.",
-            "type" : "source-node",
-            "nickname" : "GET-source-node",
-            "consumes" : null,
-            "parameters" : [ {
-                "name" : "topology-id",
-                "description" : "\n                    It is presumed that a datastore will contain many topologies. To\n                    distinguish between topologies it is vital to have UNIQUE\n                    topology identifiers.\n                ",
-                "required" : false,
-                "type" : "string",
-                "paramType" : "path"
-            }, {
-                "name" : "link-id",
-                "description" : "The identifier of a link in the topology.  \n                A link is specific to a topology to which it belongs.",
-                "required" : false,
-                "type" : "string",
-                "paramType" : "path"
-            } ],
-            "responseMessages" : null
-        } ]
-    }, {
-        "path" : "/operational/network-topology:network-topology/topology/{topology-id}/link/{link-id}/source/source-tp",
-        "operations" : [ {
-            "method" : "GET",
-            "summary" : null,
-            "notes" : "Termination point within source node that terminates the link.",
-            "type" : "source-tp",
-            "nickname" : "GET-source-tp",
-            "consumes" : null,
-            "parameters" : [ {
-                "name" : "topology-id",
-                "description" : "\n                    It is presumed that a datastore will contain many topologies. To\n                    distinguish between topologies it is vital to have UNIQUE\n                    topology identifiers.\n                ",
-                "required" : false,
-                "type" : "string",
-                "paramType" : "path"
-            }, {
-                "name" : "link-id",
-                "description" : "The identifier of a link in the topology.  \n                A link is specific to a topology to which it belongs.",
-                "required" : false,
-                "type" : "string",
-                "paramType" : "path"
-            } ],
-            "responseMessages" : null
-        } ]
-    }, {
-        "path" : "/operational/network-topology:network-topology/topology/{topology-id}/link/{link-id}/supporting-link/{link-ref}",
-        "operations" : [ {
-            "method" : "GET",
-            "summary" : null,
-            "notes" : null,
-            "type" : "supporting-link",
-            "nickname" : "GET-supporting-link",
-            "consumes" : null,
-            "parameters" : [ {
-                "name" : "topology-id",
-                "description" : "\n                    It is presumed that a datastore will contain many topologies. To\n                    distinguish between topologies it is vital to have UNIQUE\n                    topology identifiers.\n                ",
-                "required" : false,
-                "type" : "string",
-                "paramType" : "path"
-            }, {
-                "name" : "link-id",
-                "description" : "The identifier of a link in the topology.  \n                A link is specific to a topology to which it belongs.",
-                "required" : false,
-                "type" : "string",
-                "paramType" : "path"
-            }, {
-                "name" : "link-ref",
-                "description" : null,
-                "required" : false,
-                "type" : "string",
-                "paramType" : "path"
-            } ],
-            "responseMessages" : null
-        } ]
-    }, {
-        "path" : "/operational/network-topology:network-topology/topology/{topology-id}/link/{link-id}/supporting-link/{link-ref}/link-ref",
-        "operations" : [ {
-            "method" : "GET",
-            "summary" : null,
-            "notes" : null,
-            "type" : "link-ref",
-            "nickname" : "GET-link-ref",
-            "consumes" : null,
-            "parameters" : [ {
-                "name" : "topology-id",
-                "description" : "\n                    It is presumed that a datastore will contain many topologies. To\n                    distinguish between topologies it is vital to have UNIQUE\n                    topology identifiers.\n                ",
-                "required" : false,
-                "type" : "string",
-                "paramType" : "path"
-            }, {
-                "name" : "link-id",
-                "description" : "The identifier of a link in the topology.  \n                A link is specific to a topology to which it belongs.",
-                "required" : false,
-                "type" : "string",
-                "paramType" : "path"
-            }, {
-                "name" : "link-ref",
-                "description" : null,
-                "required" : false,
-                "type" : "string",
-                "paramType" : "path"
-            } ],
-            "responseMessages" : null
-        } ]
-    }, {
-        "path" : "/operational/network-topology:network-topology/topology/{topology-id}/node/{node-id}",
-        "operations" : [ {
-            "method" : "GET",
-            "summary" : null,
-            "notes" : "The list of network nodes defined for the topology.",
-            "type" : "node",
-            "nickname" : "GET-node",
-            "consumes" : null,
-            "parameters" : [ {
-                "name" : "topology-id",
-                "description" : "\n                    It is presumed that a datastore will contain many topologies. To\n                    distinguish between topologies it is vital to have UNIQUE\n                    topology identifiers.\n                ",
-                "required" : false,
-                "type" : "string",
-                "paramType" : "path"
-            }, {
-                "name" : "node-id",
-                "description" : "The identifier of a node in the topology.  \n                A node is specific to a topology to which it belongs.",
-                "required" : false,
-                "type" : "string",
-                "paramType" : "path"
-            } ],
-            "responseMessages" : null
-        } ]
-    }, {
-        "path" : "/operational/network-topology:network-topology/topology/{topology-id}/node/{node-id}/node-id",
-        "operations" : [ {
-            "method" : "GET",
-            "summary" : null,
-            "notes" : "The identifier of a node in the topology.  \n                A node is specific to a topology to which it belongs.",
-            "type" : "node-id",
-            "nickname" : "GET-node-id",
-            "consumes" : null,
-            "parameters" : [ {
-                "name" : "topology-id",
-                "description" : "\n                    It is presumed that a datastore will contain many topologies. To\n                    distinguish between topologies it is vital to have UNIQUE\n                    topology identifiers.\n                ",
-                "required" : false,
-                "type" : "string",
-                "paramType" : "path"
-            }, {
-                "name" : "node-id",
-                "description" : "The identifier of a node in the topology.  \n                A node is specific to a topology to which it belongs.",
-                "required" : false,
-                "type" : "string",
-                "paramType" : "path"
-            } ],
-            "responseMessages" : null
-        } ]
-    }, {
-        "path" : "/operational/network-topology:network-topology/topology/{topology-id}/node/{node-id}/supporting-node/{node-ref}",
-        "operations" : [ {
-            "method" : "GET",
-            "summary" : null,
-            "notes" : "This list defines vertical layering information for nodes. \n                It allows to capture for any given node, which node (or nodes)\n                in the corresponding underlay topology it maps onto.  \n                A node can map to zero, one, or more nodes below it;\n                accordingly there can be zero, one, or more elements in the list.\n                If there are specific layering requirements, for example\n                specific to a particular type of topology that only allows\n                for certain layering relationships, the choice\n                below can be augmented with additional cases.\n                A list has been chosen rather than a leaf-list in order \n                to provide room for augmentations, e.g. for \n                statistics or priorization information associated with \n                supporting nodes.",
-            "type" : "supporting-node",
-            "nickname" : "GET-supporting-node",
-            "consumes" : null,
-            "parameters" : [ {
-                "name" : "topology-id",
-                "description" : "\n                    It is presumed that a datastore will contain many topologies. To\n                    distinguish between topologies it is vital to have UNIQUE\n                    topology identifiers.\n                ",
-                "required" : false,
-                "type" : "string",
-                "paramType" : "path"
-            }, {
-                "name" : "node-id",
-                "description" : "The identifier of a node in the topology.  \n                A node is specific to a topology to which it belongs.",
-                "required" : false,
-                "type" : "string",
-                "paramType" : "path"
-            }, {
-                "name" : "node-ref",
-                "description" : null,
-                "required" : false,
-                "type" : "string",
-                "paramType" : "path"
-            } ],
-            "responseMessages" : null
-        } ]
-    }, {
-        "path" : "/operational/network-topology:network-topology/topology/{topology-id}/node/{node-id}/supporting-node/{node-ref}/node-ref",
-        "operations" : [ {
-            "method" : "GET",
-            "summary" : null,
-            "notes" : null,
-            "type" : "node-ref",
-            "nickname" : "GET-node-ref",
-            "consumes" : null,
-            "parameters" : [ {
-                "name" : "topology-id",
-                "description" : "\n                    It is presumed that a datastore will contain many topologies. To\n                    distinguish between topologies it is vital to have UNIQUE\n                    topology identifiers.\n                ",
-                "required" : false,
-                "type" : "string",
-                "paramType" : "path"
-            }, {
-                "name" : "node-id",
-                "description" : "The identifier of a node in the topology.  \n                A node is specific to a topology to which it belongs.",
-                "required" : false,
-                "type" : "string",
-                "paramType" : "path"
-            }, {
-                "name" : "node-ref",
-                "description" : null,
-                "required" : false,
-                "type" : "string",
-                "paramType" : "path"
-            } ],
-            "responseMessages" : null
-        } ]
-    }, {
-        "path" : "/operational/network-topology:network-topology/topology/{topology-id}/node/{node-id}/termination-point/{tp-id}",
-        "operations" : [ {
-            "method" : "GET",
-            "summary" : null,
-            "notes" : "A termination point can terminate a link.  \n                        Depending on the type of topology, a termination point could, \n                        for example, refer to a port or an interface.",
-            "type" : "termination-point",
-            "nickname" : "GET-termination-point",
-            "consumes" : null,
-            "parameters" : [ {
-                "name" : "topology-id",
-                "description" : "\n                    It is presumed that a datastore will contain many topologies. To\n                    distinguish between topologies it is vital to have UNIQUE\n                    topology identifiers.\n                ",
-                "required" : false,
-                "type" : "string",
-                "paramType" : "path"
-            }, {
-                "name" : "node-id",
-                "description" : "The identifier of a node in the topology.  \n                A node is specific to a topology to which it belongs.",
-                "required" : false,
-                "type" : "string",
-                "paramType" : "path"
-            }, {
-                "name" : "tp-id",
-                "description" : null,
-                "required" : false,
-                "type" : "string",
-                "paramType" : "path"
-            } ],
-            "responseMessages" : null
-        } ]
-    }, {
-        "path" : "/operational/network-topology:network-topology/topology/{topology-id}/node/{node-id}/termination-point/{tp-id}/tp-id",
-        "operations" : [ {
-            "method" : "GET",
-            "summary" : null,
-            "notes" : null,
-            "type" : "tp-id",
-            "nickname" : "GET-tp-id",
-            "consumes" : null,
-            "parameters" : [ {
-                "name" : "topology-id",
-                "description" : "\n                    It is presumed that a datastore will contain many topologies. To\n                    distinguish between topologies it is vital to have UNIQUE\n                    topology identifiers.\n                ",
-                "required" : false,
-                "type" : "string",
-                "paramType" : "path"
-            }, {
-                "name" : "node-id",
-                "description" : "The identifier of a node in the topology.  \n                A node is specific to a topology to which it belongs.",
-                "required" : false,
-                "type" : "string",
-                "paramType" : "path"
-            }, {
-                "name" : "tp-id",
-                "description" : null,
-                "required" : false,
-                "type" : "string",
-                "paramType" : "path"
-            } ],
-            "responseMessages" : null
-        } ]
-    }, {
-        "path" : "/operational/network-topology:network-topology/topology/{topology-id}/node/{node-id}/termination-point/{tp-id}/tp-ref",
-        "operations" : [ {
-            "method" : "GET",
-            "summary" : null,
-            "notes" : "The leaf list identifies any termination points that the \n                termination point is dependent on, or maps onto.  \n                Those termination points will themselves be contained \n                in a supporting node.  \n                This dependency information can be inferred from \n                the dependencies between links.  For this reason, \n                this item is not separately configurable.  Hence no\n                corresponding constraint needs to be articulated.  \n                The corresponding information is simply provided by the\n                implementing system.",
-            "type" : "tp-ref",
-            "nickname" : "GET-tp-ref",
-            "consumes" : null,
-            "parameters" : [ {
-                "name" : "topology-id",
-                "description" : "\n                    It is presumed that a datastore will contain many topologies. To\n                    distinguish between topologies it is vital to have UNIQUE\n                    topology identifiers.\n                ",
-                "required" : false,
-                "type" : "string",
-                "paramType" : "path"
-            }, {
-                "name" : "node-id",
-                "description" : "The identifier of a node in the topology.  \n                A node is specific to a topology to which it belongs.",
-                "required" : false,
-                "type" : "string",
-                "paramType" : "path"
-            }, {
-                "name" : "tp-id",
-                "description" : null,
-                "required" : false,
-                "type" : "string",
-                "paramType" : "path"
-            } ],
-            "responseMessages" : null
-        } ]
-    }, {
-        "path" : "/operational/network-topology:network-topology/topology/{topology-id}/topology-id",
-        "operations" : [ {
-            "method" : "GET",
-            "summary" : null,
-            "notes" : "\n                    It is presumed that a datastore will contain many topologies. To\n                    distinguish between topologies it is vital to have UNIQUE\n                    topology identifiers.\n                ",
-            "type" : "topology-id",
-            "nickname" : "GET-topology-id",
-            "consumes" : null,
-            "parameters" : [ {
-                "name" : "topology-id",
-                "description" : "\n                    It is presumed that a datastore will contain many topologies. To\n                    distinguish between topologies it is vital to have UNIQUE\n                    topology identifiers.\n                ",
-                "required" : false,
-                "type" : "string",
-                "paramType" : "path"
-            } ],
-            "responseMessages" : null
-        } ]
-    }, {
-        "path" : "/operational/network-topology:network-topology/topology/{topology-id}/topology-types",
-        "operations" : [ {
-            "method" : "GET",
-            "summary" : null,
-            "notes" : "This container is used to identify the type, or types \n                    (as a topology can support several types simultaneously), \n                    of the topology.  \n                    Topology types are the subject of several integrity constraints \n                    that an implementing server can validate in order to \n                    maintain integrity of the datastore.  \n                    Topology types are indicated through separate data nodes; \n                    the set of topology types is expected to increase over time.\n                    To add support for a new topology, an augmenting module\n                    needs to augment this container with a new empty optional \n                    container to indicate the new topology type.  \n                    The use of a container allows to indicate a subcategorization\n                    of topology types.  \n                    The container SHALL NOT be augmented with any data nodes \n                    that serve a purpose other than identifying a particular \n                    topology type.  \n                ",
-            "type" : "topology-types",
-            "nickname" : "GET-topology-types",
-            "consumes" : null,
-            "parameters" : [ {
-                "name" : "topology-id",
-                "description" : "\n                    It is presumed that a datastore will contain many topologies. To\n                    distinguish between topologies it is vital to have UNIQUE\n                    topology identifiers.\n                ",
-                "required" : false,
-                "type" : "string",
-                "paramType" : "path"
-            } ],
-            "responseMessages" : null
-        } ]
-    }, {
-        "path" : "/operational/network-topology:network-topology/topology/{topology-id}/underlay-topology/{topology-ref}",
-        "operations" : [ {
-            "method" : "GET",
-            "summary" : null,
-            "notes" : "Identifies the topology, or topologies, that this topology\n                    is dependent on.",
-            "type" : "underlay-topology",
-            "nickname" : "GET-underlay-topology",
-            "consumes" : null,
-            "parameters" : [ {
-                "name" : "topology-id",
-                "description" : "\n                    It is presumed that a datastore will contain many topologies. To\n                    distinguish between topologies it is vital to have UNIQUE\n                    topology identifiers.\n                ",
-                "required" : false,
-                "type" : "string",
-                "paramType" : "path"
-            }, {
-                "name" : "topology-ref",
-                "description" : null,
-                "required" : false,
-                "type" : "string",
-                "paramType" : "path"
-            } ],
-            "responseMessages" : null
-        } ]
-    }, {
-        "path" : "/operational/network-topology:network-topology/topology/{topology-id}/underlay-topology/{topology-ref}/topology-ref",
-        "operations" : [ {
-            "method" : "GET",
-            "summary" : null,
-            "notes" : null,
-            "type" : "topology-ref",
-            "nickname" : "GET-topology-ref",
-            "consumes" : null,
-            "parameters" : [ {
-                "name" : "topology-id",
-                "description" : "\n                    It is presumed that a datastore will contain many topologies. To\n                    distinguish between topologies it is vital to have UNIQUE\n                    topology identifiers.\n                ",
-                "required" : false,
-                "type" : "string",
-                "paramType" : "path"
-            }, {
-                "name" : "topology-ref",
-                "description" : null,
-                "required" : false,
-                "type" : "string",
-                "paramType" : "path"
-            } ],
-            "responseMessages" : null
-        } ]
-    } ],
-    "models" : {
-        "underlay-topology" : {
-            "id" : "underlay-topology",
-            "$schema" : "http://json-schema.org/draft-04/schema",
-            "properties" : {
-                "topology-ref" : {
-                    "required" : false
-                }
-            },
-            "type" : "object"
-        },
-        "network-topology" : "{\n  \"id\": \"network-topology\",\n  \"$schema\": \"http://json-schema.org/draft-04/schema\",\n  \"properties\": {\"topology\": {\n    \"items\": {\"$ref\": \"topology\"},\n    \"description\": \"\\n                This is the model of an abstract topology.\\n                A topology contins nodes and links.  \\n                Each topology MUST be identified by\\n                unique topology-id for reason that a network could contain many\\n                topologies.\\n            \",\n    \"type\": \"array\"\n  }},\n  \"type\": \"object\"\n}",
-        "node" : {
-            "id" : "node",
-            "$schema" : "http://json-schema.org/draft-04/schema",
-            "properties" : {
-                "supporting-node" : {
-                    "items" : {
-                        "$ref" : "supporting-node"
-                    },
-                    "description" : "This list defines vertical layering information for nodes. \n                It allows to capture for any given node, which node (or nodes)\n                in the corresponding underlay topology it maps onto.  \n                A node can map to zero, one, or more nodes below it;\n                accordingly there can be zero, one, or more elements in the list.\n                If there are specific layering requirements, for example\n                specific to a particular type of topology that only allows\n                for certain layering relationships, the choice\n                below can be augmented with additional cases.\n                A list has been chosen rather than a leaf-list in order \n                to provide room for augmentations, e.g. for \n                statistics or priorization information associated with \n                supporting nodes.",
-                    "type" : "array"
-                },
-                "termination-point" : {
-                    "items" : {
-                        "$ref" : "termination-point"
-                    },
-                    "description" : "A termination point can terminate a link.  \n                        Depending on the type of topology, a termination point could, \n                        for example, refer to a port or an interface.",
-                    "type" : "array"
-                },
-                "node-id" : {
-                    "description" : "The identifier of a node in the topology.  \n                A node is specific to a topology to which it belongs.",
-                    "type" : "string",
-                    "required" : false
-                }
-            },
-            "type" : "object"
-        },
-        "supporting-node" : {
-            "id" : "supporting-node",
-            "$schema" : "http://json-schema.org/draft-04/schema",
-            "properties" : {
-                "node-ref" : {
-                    "required" : false
-                }
-            },
-            "type" : "object"
-        },
-        "link" : {
-            "id" : "link",
-            "$schema" : "http://json-schema.org/draft-04/schema",
-            "properties" : {
-                "source" : {
-                    "properties" : {
-                        "source-node" : {
-                            "description" : "Source node identifier, must be in same topology.",
-                            "required" : true
-                        },
-                        "source-tp" : {
-                            "description" : "Termination point within source node that terminates the link.",
-                            "required" : false
-                        }
-                    },
-                    "type" : "object"
-                },
-                "supporting-link" : {
-                    "items" : {
-                        "$ref" : "supporting-link"
-                    },
-                    "type" : "array"
-                },
-                "link-id" : {
-                    "description" : "The identifier of a link in the topology.  \n                A link is specific to a topology to which it belongs.",
-                    "type" : "string",
-                    "required" : false
-                },
-                "destination" : {
-                    "properties" : {
-                        "dest-node" : {
-                            "description" : "Destination node identifier, must be in same topology.",
-                            "required" : true
-                        },
-                        "dest-tp" : {
-                            "description" : "Termination point within destination node that terminates the link.",
-                            "required" : false
-                        }
-                    },
-                    "type" : "object"
-                }
-            },
-            "type" : "object"
-        },
-        "termination-point" : {
-            "id" : "termination-point",
-            "$schema" : "http://json-schema.org/draft-04/schema",
-            "properties" : {
-                "tp-ref" : {
-                    "items" : { },
-                    "description" : "The leaf list identifies any termination points that the \n                termination point is dependent on, or maps onto.  \n                Those termination points will themselves be contained \n                in a supporting node.  \n                This dependency information can be inferred from \n                the dependencies between links.  For this reason, \n                this item is not separately configurable.  Hence no\n                corresponding constraint needs to be articulated.  \n                The corresponding information is simply provided by the\n                implementing system.",
-                    "required" : false,
-                    "type" : "array"
-                },
-                "tp-id" : {
-                    "type" : "string",
-                    "required" : false
-                }
-            },
-            "type" : "object"
-        },
-        "topology" : {
-            "id" : "topology",
-            "$schema" : "http://json-schema.org/draft-04/schema",
-            "properties" : {
-                "underlay-topology" : {
-                    "items" : {
-                        "$ref" : "underlay-topology"
-                    },
-                    "description" : "Identifies the topology, or topologies, that this topology\n                    is dependent on.",
-                    "type" : "array"
-                },
-                "node" : {
-                    "items" : {
-                        "$ref" : "node"
-                    },
-                    "description" : "The list of network nodes defined for the topology.",
-                    "type" : "array"
-                },
-                "topology-types" : {
-                    "description" : "This container is used to identify the type, or types \n                    (as a topology can support several types simultaneously), \n                    of the topology.  \n                    Topology types are the subject of several integrity constraints \n                    that an implementing server can validate in order to \n                    maintain integrity of the datastore.  \n                    Topology types are indicated through separate data nodes; \n                    the set of topology types is expected to increase over time.\n                    To add support for a new topology, an augmenting module\n                    needs to augment this container with a new empty optional \n                    container to indicate the new topology type.  \n                    The use of a container allows to indicate a subcategorization\n                    of topology types.  \n                    The container SHALL NOT be augmented with any data nodes \n                    that serve a purpose other than identifying a particular \n                    topology type.  \n                ",
-                    "properties" : { },
-                    "type" : "object"
-                },
-                "topology-id" : {
-                    "description" : "\n                    It is presumed that a datastore will contain many topologies. To\n                    distinguish between topologies it is vital to have UNIQUE\n                    topology identifiers.\n                ",
-                    "type" : "string",
-                    "required" : false
-                },
-                "link" : {
-                    "items" : {
-                        "$ref" : "link"
-                    },
-                    "description" : "\n                    A Network Link connects a by Local (Source) node and\n                    a Remote (Destination) Network Nodes via a set of the \n                    nodes' termination points. \n                    As it is possible to have several links between the same\n                    source and destination nodes, and as a link could potentially\n                    be re-homed between termination points, to ensure that we \n                    would always know to distinguish between links, every link \n                    is identified by a dedicated link identifier.  \n                    Note that a link models a point-to-point link, not a multipoint\n                    link.  \n                    Layering dependencies on links in underlay topologies are\n                    not represented as the layering information of nodes and of \n                    termination points is sufficient.  \n                ",
-                    "type" : "array"
-                }
-            },
-            "type" : "object"
-        },
-        "supporting-link" : {
-            "id" : "supporting-link",
-            "$schema" : "http://json-schema.org/draft-04/schema",
-            "properties" : {
-                "link-ref" : {
-                    "required" : false
-                }
-            },
-            "type" : "object"
-        }
-    }
-}
diff --git a/restconf/restconf-openapi/src/test/resources/wadl.xml b/restconf/restconf-openapi/src/test/resources/wadl.xml
deleted file mode 100644 (file)
index 7c3488f..0000000
+++ /dev/null
@@ -1,142 +0,0 @@
-<?xml version="1.0"?>
-<application xmlns="http://wadl.dev.java.net/2009/02" xmlns:inet="urn:ietf:params:xml:ns:yang:ietf-inet-types"
-             xmlns:nt="urn:TBD:params:xml:ns:yang:network-topology">
-
-  <grammars>
-    <include href="network-topology.yang"/>
-    <include href="ietf-inet-types.yang"/>
-  </grammars>
-
-  <resources base="http://localhost:9998/restconf">
-    <resource path="operational">
-      <resource path="network-topology:network-topology">
-        <method name="GET">
-          <response>
-            <representation mediaType="application/xml" element="nt:network-topology"/>
-            <representation mediaType="text/xml" element="nt:network-topology"/>
-            <representation mediaType="application/json" element="nt:network-topology"/>
-            <representation mediaType="application/yang.data+xml" element="nt:network-topology"/>
-            <representation mediaType="application/yang.data+json" element="nt:network-topology"/>
-          </response>
-        </method>
-        <resource path="topology/{topology-id}">
-          <param required="true" style="template" name="topology-id" type="nt:topology-id"/>
-          <method name="GET">
-            <response>
-              <representation mediaType="application/xml" element="nt:topology"/>
-              <representation mediaType="text/xml" element="nt:topology"/>
-              <representation mediaType="application/json" element="nt:topology"/>
-              <representation mediaType="application/yang.data+xml" element="nt:topology"/>
-              <representation mediaType="application/yang.data+json" element="nt:topology"/>
-            </response>
-          </method>
-          <resource path="link/{link-id}">
-            <param required="true" style="template" name="link-id" type="nt:link-id"/>
-            <method name="GET">
-              <response>
-                <representation mediaType="application/xml" element="nt:link"/>
-                <representation mediaType="text/xml" element="nt:link"/>
-                <representation mediaType="application/json" element="nt:link"/>
-                <representation mediaType="application/yang.data+xml" element="nt:link"/>
-                <representation mediaType="application/yang.data+json" element="nt:link"/>
-              </response>
-            </method>
-            <resource path="destination">
-              <method name="GET">
-                <response>
-                  <representation mediaType="application/xml" element="nt:destination"/>
-                  <representation mediaType="text/xml" element="nt:destination"/>
-                  <representation mediaType="application/json" element="nt:destination"/>
-                  <representation mediaType="application/yang.data+xml" element="nt:destination"/>
-                  <representation mediaType="application/yang.data+json" element="nt:destination"/>
-                </response>
-              </method>
-            </resource>
-            <resource path="source">
-              <method name="GET">
-                <response>
-                  <representation mediaType="application/xml" element="nt:source"/>
-                  <representation mediaType="text/xml" element="nt:source"/>
-                  <representation mediaType="application/json" element="nt:source"/>
-                  <representation mediaType="application/yang.data+xml" element="nt:source"/>
-                  <representation mediaType="application/yang.data+json" element="nt:source"/>
-                </response>
-              </method>
-            </resource>
-            <resource path="supporting-link/{link-ref}">
-              <param required="true" style="template" name="link-ref" type="nt:link-ref"/>
-              <method name="GET">
-                <response>
-                  <representation mediaType="application/xml" element="nt:supporting-link"/>
-                  <representation mediaType="text/xml" element="nt:supporting-link"/>
-                  <representation mediaType="application/json" element="nt:supporting-link"/>
-                  <representation mediaType="application/yang.data+xml" element="nt:supporting-link"/>
-                  <representation mediaType="application/yang.data+json" element="nt:supporting-link"/>
-                </response>
-              </method>
-            </resource>
-          </resource>
-          <resource path="node/{node-id}">
-            <param required="true" style="template" name="node-id" type="nt:node-id"/>
-            <method name="GET">
-              <response>
-                <representation mediaType="application/xml" element="nt:node"/>
-                <representation mediaType="text/xml" element="nt:node"/>
-                <representation mediaType="application/json" element="nt:node"/>
-                <representation mediaType="application/yang.data+xml" element="nt:node"/>
-                <representation mediaType="application/yang.data+json" element="nt:node"/>
-              </response>
-            </method>
-            <resource path="supporting-node/{node-ref}">
-              <param required="true" style="template" name="node-ref" type="nt:node-ref"/>
-              <method name="GET">
-                <response>
-                  <representation mediaType="application/xml" element="nt:supporting-node"/>
-                  <representation mediaType="text/xml" element="nt:supporting-node"/>
-                  <representation mediaType="application/json" element="nt:supporting-node"/>
-                  <representation mediaType="application/yang.data+xml" element="nt:supporting-node"/>
-                  <representation mediaType="application/yang.data+json" element="nt:supporting-node"/>
-                </response>
-              </method>
-            </resource>
-            <resource path="termination-point/{tp-id}">
-              <param required="true" style="template" name="tp-id" type="nt:tp-id"/>
-              <method name="GET">
-                <response>
-                  <representation mediaType="application/xml" element="nt:termination-point"/>
-                  <representation mediaType="text/xml" element="nt:termination-point"/>
-                  <representation mediaType="application/json" element="nt:termination-point"/>
-                  <representation mediaType="application/yang.data+xml" element="nt:termination-point"/>
-                  <representation mediaType="application/yang.data+json" element="nt:termination-point"/>
-                </response>
-              </method>
-            </resource>
-          </resource>
-          <resource path="topology-types">
-            <method name="GET">
-              <response>
-                <representation mediaType="application/xml" element="nt:topology-types"/>
-                <representation mediaType="text/xml" element="nt:topology-types"/>
-                <representation mediaType="application/json" element="nt:topology-types"/>
-                <representation mediaType="application/yang.data+xml" element="nt:topology-types"/>
-                <representation mediaType="application/yang.data+json" element="nt:topology-types"/>
-              </response>
-            </method>
-          </resource>
-          <resource path="underlay-topology/{topology-ref}">
-            <param required="true" style="template" name="topology-ref" type="nt:topology-ref"/>
-            <method name="GET">
-              <response>
-                <representation mediaType="application/xml" element="nt:underlay-topology"/>
-                <representation mediaType="text/xml" element="nt:underlay-topology"/>
-                <representation mediaType="application/json" element="nt:underlay-topology"/>
-                <representation mediaType="application/yang.data+xml" element="nt:underlay-topology"/>
-                <representation mediaType="application/yang.data+json" element="nt:underlay-topology"/>
-              </response>
-            </method>
-          </resource>
-        </resource>
-      </resource>
-    </resource>
-  </resources>
-</application>
index ac74c976ed91abbbdd40c878ecba93434dfdb992..8a763831b69e978cc10229d78b128a725cab74de 100644 (file)
@@ -3,7 +3,7 @@
   "info": {
     "version": "1.0.0",
     "title": "action-types",
-    "description": "We are providing full API for configurational data which can be edited (by POST, PUT, PATCH and DELETE).\nFor operational data we only provide GET API.\n\nFor majority of request you can see only config data in examples. Thats because we can show only one example\nper request. The exception when you can see operational data in example is when data are representing\noperational (config false) container with no config data in it."
+    "description": "We are providing full API for configurational data which can be edited (by POST, PUT, PATCH and DELETE).\nFor operational data we only provide GET API.\n\nFor majority of request you can see only config data in examples. That is because we can show only one example\nper request. The exception when you can see operational data in example is when data are representing\noperational (config false) container with no config data in it."
   },
   "servers": [
     {
index bc8af19059bbbfe0aebf231511321b7880f96915..18db81428ca0d1cb2ecd98ef137d6f030bf30b32 100644 (file)
@@ -3,7 +3,7 @@
   "info": {
     "version": "1.0.0",
     "title": "Controller modules of RESTCONF",
-    "description": "We are providing full API for configurational data which can be edited (by POST, PUT, PATCH and DELETE).\nFor operational data we only provide GET API.\n\nFor majority of request you can see only config data in examples. Thats because we can show only one example\nper request. The exception when you can see operational data in example is when data are representing\noperational (config false) container with no config data in it."
+    "description": "We are providing full API for configurational data which can be edited (by POST, PUT, PATCH and DELETE).\nFor operational data we only provide GET API.\n\nFor majority of request you can see only config data in examples. That is because we can show only one example\nper request. The exception when you can see operational data in example is when data are representing\noperational (config false) container with no config data in it."
   },
   "servers": [
     {
index 4c28ff92342b8d1524830299a8db808f91dca91f..9b52fb1e2176e060a87348b6a4909a148d6d7ef7 100644 (file)
@@ -3,7 +3,7 @@
   "info": {
     "version": "1.0.0",
     "title": "choice-test",
-    "description": "We are providing full API for configurational data which can be edited (by POST, PUT, PATCH and DELETE).\nFor operational data we only provide GET API.\n\nFor majority of request you can see only config data in examples. Thats because we can show only one example\nper request. The exception when you can see operational data in example is when data are representing\noperational (config false) container with no config data in it."
+    "description": "We are providing full API for configurational data which can be edited (by POST, PUT, PATCH and DELETE).\nFor operational data we only provide GET API.\n\nFor majority of request you can see only config data in examples. That is because we can show only one example\nper request. The exception when you can see operational data in example is when data are representing\noperational (config false) container with no config data in it."
   },
   "servers": [
     {
index d16cd6dd59d3506aba4f29d1fb9fcb5fd9fb81ea..9157d85a222feca682f4bddfca37a47764f4dffc 100644 (file)
@@ -3,7 +3,7 @@
   "info": {
     "version": "1.0.0",
     "title": "definition-test",
-    "description": "We are providing full API for configurational data which can be edited (by POST, PUT, PATCH and DELETE).\nFor operational data we only provide GET API.\n\nFor majority of request you can see only config data in examples. Thats because we can show only one example\nper request. The exception when you can see operational data in example is when data are representing\noperational (config false) container with no config data in it."
+    "description": "We are providing full API for configurational data which can be edited (by POST, PUT, PATCH and DELETE).\nFor operational data we only provide GET API.\n\nFor majority of request you can see only config data in examples. That is because we can show only one example\nper request. The exception when you can see operational data in example is when data are representing\noperational (config false) container with no config data in it."
   },
   "servers": [
     {
index 2ec31b4ae3512094b483051c551a21ee0b6ef1ce..852fb2acc81b1f428a3ac189d96692b51d720dcc 100644 (file)
@@ -3,7 +3,7 @@
   "info": {
     "version": "1.0.0",
     "title": "mandatory-test",
-    "description": "We are providing full API for configurational data which can be edited (by POST, PUT, PATCH and DELETE).\nFor operational data we only provide GET API.\n\nFor majority of request you can see only config data in examples. Thats because we can show only one example\nper request. The exception when you can see operational data in example is when data are representing\noperational (config false) container with no config data in it."
+    "description": "We are providing full API for configurational data which can be edited (by POST, PUT, PATCH and DELETE).\nFor operational data we only provide GET API.\n\nFor majority of request you can see only config data in examples. That is because we can show only one example\nper request. The exception when you can see operational data in example is when data are representing\noperational (config false) container with no config data in it."
   },
   "servers": [
     {
index d067e2611b9856e69ecc45fbb77c8bf9a57ce786..6be3930cd8a8181e4b8a2de7a6853ae74bfbaf96 100644 (file)
@@ -3,7 +3,7 @@
   "info": {
     "version": "1.0.0",
     "title": "my-yang",
-    "description": "We are providing full API for configurational data which can be edited (by POST, PUT, PATCH and DELETE).\nFor operational data we only provide GET API.\n\nFor majority of request you can see only config data in examples. Thats because we can show only one example\nper request. The exception when you can see operational data in example is when data are representing\noperational (config false) container with no config data in it."
+    "description": "We are providing full API for configurational data which can be edited (by POST, PUT, PATCH and DELETE).\nFor operational data we only provide GET API.\n\nFor majority of request you can see only config data in examples. That is because we can show only one example\nper request. The exception when you can see operational data in example is when data are representing\noperational (config false) container with no config data in it."
   },
   "servers": [
     {
index 492bc77bd4bec356b6b415b3025c2a9c99cebb07..a2c579275c1fbf89189d8a6573fd002da11a6fc4 100644 (file)
@@ -3,7 +3,7 @@
   "info": {
     "version": "1.0.0",
     "title": "opflex",
-    "description": "We are providing full API for configurational data which can be edited (by POST, PUT, PATCH and DELETE).\nFor operational data we only provide GET API.\n\nFor majority of request you can see only config data in examples. Thats because we can show only one example\nper request. The exception when you can see operational data in example is when data are representing\noperational (config false) container with no config data in it."
+    "description": "We are providing full API for configurational data which can be edited (by POST, PUT, PATCH and DELETE).\nFor operational data we only provide GET API.\n\nFor majority of request you can see only config data in examples. That is because we can show only one example\nper request. The exception when you can see operational data in example is when data are representing\noperational (config false) container with no config data in it."
   },
   "servers": [
     {
index a6a868231d7ef5670e5a65cceabeb20ab102f780..17be0d53368ccf4cad0e13bbad3ade0adf05a2cf 100644 (file)
@@ -3,7 +3,7 @@
   "info": {
     "version": "1.0.0",
     "title": "path-params-test",
-    "description": "We are providing full API for configurational data which can be edited (by POST, PUT, PATCH and DELETE).\nFor operational data we only provide GET API.\n\nFor majority of request you can see only config data in examples. Thats because we can show only one example\nper request. The exception when you can see operational data in example is when data are representing\noperational (config false) container with no config data in it."
+    "description": "We are providing full API for configurational data which can be edited (by POST, PUT, PATCH and DELETE).\nFor operational data we only provide GET API.\n\nFor majority of request you can see only config data in examples. That is because we can show only one example\nper request. The exception when you can see operational data in example is when data are representing\noperational (config false) container with no config data in it."
   },
   "servers": [
     {
index 93b66f7f559747302a896133034e57e1ffb7433f..80e77f989e8261d6fc38840ade5827dadddd199a 100644 (file)
@@ -3,7 +3,7 @@
   "info": {
     "version": "1.0.0",
     "title": "recursive",
-    "description": "We are providing full API for configurational data which can be edited (by POST, PUT, PATCH and DELETE).\nFor operational data we only provide GET API.\n\nFor majority of request you can see only config data in examples. Thats because we can show only one example\nper request. The exception when you can see operational data in example is when data are representing\noperational (config false) container with no config data in it."
+    "description": "We are providing full API for configurational data which can be edited (by POST, PUT, PATCH and DELETE).\nFor operational data we only provide GET API.\n\nFor majority of request you can see only config data in examples. That is because we can show only one example\nper request. The exception when you can see operational data in example is when data are representing\noperational (config false) container with no config data in it."
   },
   "servers": [
     {
index 9572222ae2aedc74b3fa15d2c7883cccb291e809..35f76cb3ede7b1474b34536a7d97047166dd93c9 100644 (file)
@@ -3,7 +3,7 @@
   "info": {
     "version": "1.0.0",
     "title": "strings-from-regex",
-    "description": "We are providing full API for configurational data which can be edited (by POST, PUT, PATCH and DELETE).\nFor operational data we only provide GET API.\n\nFor majority of request you can see only config data in examples. Thats because we can show only one example\nper request. The exception when you can see operational data in example is when data are representing\noperational (config false) container with no config data in it."
+    "description": "We are providing full API for configurational data which can be edited (by POST, PUT, PATCH and DELETE).\nFor operational data we only provide GET API.\n\nFor majority of request you can see only config data in examples. That is because we can show only one example\nper request. The exception when you can see operational data in example is when data are representing\noperational (config false) container with no config data in it."
   },
   "servers": [
     {
index 6561565c50a7130e3a73640ecad7ef7f5d7a53a4..9cc2303e52bcd413ada988a92681b0b9598578ed 100644 (file)
@@ -3,7 +3,7 @@
   "info": {
     "version": "1.0.0",
     "title": "string-types",
-    "description": "We are providing full API for configurational data which can be edited (by POST, PUT, PATCH and DELETE).\nFor operational data we only provide GET API.\n\nFor majority of request you can see only config data in examples. Thats because we can show only one example\nper request. The exception when you can see operational data in example is when data are representing\noperational (config false) container with no config data in it."
+    "description": "We are providing full API for configurational data which can be edited (by POST, PUT, PATCH and DELETE).\nFor operational data we only provide GET API.\n\nFor majority of request you can see only config data in examples. That is because we can show only one example\nper request. The exception when you can see operational data in example is when data are representing\noperational (config false) container with no config data in it."
   },
   "servers": [
     {
index 398a18fab47a199ca5e616f7f21a2d5054adc87d..15647d847f5f8333ddb9dbf4020404ae7bcf9a7a 100644 (file)
@@ -3,7 +3,7 @@
   "info": {
     "version": "1.0.0",
     "title": "test-container-childs",
-    "description": "We are providing full API for configurational data which can be edited (by POST, PUT, PATCH and DELETE).\nFor operational data we only provide GET API.\n\nFor majority of request you can see only config data in examples. Thats because we can show only one example\nper request. The exception when you can see operational data in example is when data are representing\noperational (config false) container with no config data in it."
+    "description": "We are providing full API for configurational data which can be edited (by POST, PUT, PATCH and DELETE).\nFor operational data we only provide GET API.\n\nFor majority of request you can see only config data in examples. That is because we can show only one example\nper request. The exception when you can see operational data in example is when data are representing\noperational (config false) container with no config data in it."
   },
   "servers": [
     {
index 4cf79d6487511b1ae2e8eb5fa42894f4f2edf286..d4b8bf7b90a0d672573d6b0b0e3e1d7a95dbaff0 100644 (file)
@@ -3,7 +3,7 @@
   "info": {
     "version": "1.0.0",
     "title": "toaster-augmented",
-    "description": "We are providing full API for configurational data which can be edited (by POST, PUT, PATCH and DELETE).\nFor operational data we only provide GET API.\n\nFor majority of request you can see only config data in examples. Thats because we can show only one example\nper request. The exception when you can see operational data in example is when data are representing\noperational (config false) container with no config data in it."
+    "description": "We are providing full API for configurational data which can be edited (by POST, PUT, PATCH and DELETE).\nFor operational data we only provide GET API.\n\nFor majority of request you can see only config data in examples. That is because we can show only one example\nper request. The exception when you can see operational data in example is when data are representing\noperational (config false) container with no config data in it."
   },
   "servers": [
     {
index a025d7cd815a061fbd5faf87011e9a69175abc78..23f1ebf3e57d0719e402b1d1e658e4b8699c1231 100644 (file)
@@ -3,7 +3,7 @@
   "info": {
     "version": "1.0.0",
     "title": "toaster",
-    "description": "We are providing full API for configurational data which can be edited (by POST, PUT, PATCH and DELETE).\nFor operational data we only provide GET API.\n\nFor majority of request you can see only config data in examples. Thats because we can show only one example\nper request. The exception when you can see operational data in example is when data are representing\noperational (config false) container with no config data in it."
+    "description": "We are providing full API for configurational data which can be edited (by POST, PUT, PATCH and DELETE).\nFor operational data we only provide GET API.\n\nFor majority of request you can see only config data in examples. That is because we can show only one example\nper request. The exception when you can see operational data in example is when data are representing\noperational (config false) container with no config data in it."
   },
   "servers": [
     {
index d88f17008d2e39659406d3cb89fd73e2e2cdb7a7..ce1ce929c7079f4c9630fd40b12cda256dd83662 100644 (file)
@@ -3,7 +3,7 @@
   "info": {
     "version": "1.0.0",
     "title": "toaster2",
-    "description": "We are providing full API for configurational data which can be edited (by POST, PUT, PATCH and DELETE).\nFor operational data we only provide GET API.\n\nFor majority of request you can see only config data in examples. Thats because we can show only one example\nper request. The exception when you can see operational data in example is when data are representing\noperational (config false) container with no config data in it."
+    "description": "We are providing full API for configurational data which can be edited (by POST, PUT, PATCH and DELETE).\nFor operational data we only provide GET API.\n\nFor majority of request you can see only config data in examples. That is because we can show only one example\nper request. The exception when you can see operational data in example is when data are representing\noperational (config false) container with no config data in it."
   },
   "servers": [
     {
index 7f1d2d57c07b935cb9c80a0213eec787075fe893..18023ed2510472c2e4f2bb70ee8e60d5df12cd3a 100644 (file)
@@ -3,7 +3,7 @@
   "info": {
     "version": "1.0.0",
     "title": "typed-params",
-    "description": "We are providing full API for configurational data which can be edited (by POST, PUT, PATCH and DELETE).\nFor operational data we only provide GET API.\n\nFor majority of request you can see only config data in examples. Thats because we can show only one example\nper request. The exception when you can see operational data in example is when data are representing\noperational (config false) container with no config data in it."
+    "description": "We are providing full API for configurational data which can be edited (by POST, PUT, PATCH and DELETE).\nFor operational data we only provide GET API.\n\nFor majority of request you can see only config data in examples. That is because we can show only one example\nper request. The exception when you can see operational data in example is when data are representing\noperational (config false) container with no config data in it."
   },
   "servers": [
     {
index 2e1b3bef9acee8efdee9e24592925c47df055e9d..6a1430c25962c4a609c2db0b00a1ecd0de5ae95a 100644 (file)
@@ -3,7 +3,7 @@
   "info": {
     "version": "1.0.0",
     "title": "action-types",
-    "description": "We are providing full API for configurational data which can be edited (by POST, PUT, PATCH and DELETE).\nFor operational data we only provide GET API.\n\nFor majority of request you can see only config data in examples. Thats because we can show only one example\nper request. The exception when you can see operational data in example is when data are representing\noperational (config false) container with no config data in it."
+    "description": "We are providing full API for configurational data which can be edited (by POST, PUT, PATCH and DELETE).\nFor operational data we only provide GET API.\n\nFor majority of request you can see only config data in examples. That is because we can show only one example\nper request. The exception when you can see operational data in example is when data are representing\noperational (config false) container with no config data in it."
   },
   "servers": [
     {
index 8c3d50ef22ee784b40409a09c594f46fd85f6753..172138ef1e1860c62a01d5b14251b768f90bfa90 100644 (file)
@@ -3,7 +3,7 @@
   "info": {
     "version": "1.0.0",
     "title": "123 modules of RESTCONF",
-    "description": "We are providing full API for configurational data which can be edited (by POST, PUT, PATCH and DELETE).\nFor operational data we only provide GET API.\n\nFor majority of request you can see only config data in examples. Thats because we can show only one example\nper request. The exception when you can see operational data in example is when data are representing\noperational (config false) container with no config data in it."
+    "description": "We are providing full API for configurational data which can be edited (by POST, PUT, PATCH and DELETE).\nFor operational data we only provide GET API.\n\nFor majority of request you can see only config data in examples. That is because we can show only one example\nper request. The exception when you can see operational data in example is when data are representing\noperational (config false) container with no config data in it."
   },
   "servers": [
     {
index 51f2c2a543b7c9da28868a977e621b0b5b51a1ab..57116b0eec07b79a45f3dc5161c00302cad73540 100644 (file)
@@ -3,7 +3,7 @@
   "info": {
     "version": "1.0.0",
     "title": "choice-test",
-    "description": "We are providing full API for configurational data which can be edited (by POST, PUT, PATCH and DELETE).\nFor operational data we only provide GET API.\n\nFor majority of request you can see only config data in examples. Thats because we can show only one example\nper request. The exception when you can see operational data in example is when data are representing\noperational (config false) container with no config data in it."
+    "description": "We are providing full API for configurational data which can be edited (by POST, PUT, PATCH and DELETE).\nFor operational data we only provide GET API.\n\nFor majority of request you can see only config data in examples. That is because we can show only one example\nper request. The exception when you can see operational data in example is when data are representing\noperational (config false) container with no config data in it."
   },
   "servers": [
     {
index 5d59dc62522abc179b46c35ea002c636075f3709..8c7acfc6a9812993008da827c8969d1295c2d5ef 100644 (file)
@@ -3,7 +3,7 @@
   "info": {
     "version": "1.0.0",
     "title": "definition-test",
-    "description": "We are providing full API for configurational data which can be edited (by POST, PUT, PATCH and DELETE).\nFor operational data we only provide GET API.\n\nFor majority of request you can see only config data in examples. Thats because we can show only one example\nper request. The exception when you can see operational data in example is when data are representing\noperational (config false) container with no config data in it."
+    "description": "We are providing full API for configurational data which can be edited (by POST, PUT, PATCH and DELETE).\nFor operational data we only provide GET API.\n\nFor majority of request you can see only config data in examples. That is because we can show only one example\nper request. The exception when you can see operational data in example is when data are representing\noperational (config false) container with no config data in it."
   },
   "servers": [
     {
index 3a788f7d208b307ab640fbf8557c12b35b46366b..63664f2d6d36ac08d49df830c3e8c984185a85a1 100644 (file)
@@ -3,7 +3,7 @@
   "info": {
     "version": "1.0.0",
     "title": "mandatory-test",
-    "description": "We are providing full API for configurational data which can be edited (by POST, PUT, PATCH and DELETE).\nFor operational data we only provide GET API.\n\nFor majority of request you can see only config data in examples. Thats because we can show only one example\nper request. The exception when you can see operational data in example is when data are representing\noperational (config false) container with no config data in it."
+    "description": "We are providing full API for configurational data which can be edited (by POST, PUT, PATCH and DELETE).\nFor operational data we only provide GET API.\n\nFor majority of request you can see only config data in examples. That is because we can show only one example\nper request. The exception when you can see operational data in example is when data are representing\noperational (config false) container with no config data in it."
   },
   "servers": [
     {
index 47cb8f87d8dc0cfecfaeabb9f7ad00f086f62528..d5e1462575eb87f7f183b9cdca7a96b5cb3a287a 100644 (file)
@@ -3,7 +3,7 @@
   "info": {
     "version": "1.0.0",
     "title": "my-yang",
-    "description": "We are providing full API for configurational data which can be edited (by POST, PUT, PATCH and DELETE).\nFor operational data we only provide GET API.\n\nFor majority of request you can see only config data in examples. Thats because we can show only one example\nper request. The exception when you can see operational data in example is when data are representing\noperational (config false) container with no config data in it."
+    "description": "We are providing full API for configurational data which can be edited (by POST, PUT, PATCH and DELETE).\nFor operational data we only provide GET API.\n\nFor majority of request you can see only config data in examples. That is because we can show only one example\nper request. The exception when you can see operational data in example is when data are representing\noperational (config false) container with no config data in it."
   },
   "servers": [
     {
index 492bc77bd4bec356b6b415b3025c2a9c99cebb07..a2c579275c1fbf89189d8a6573fd002da11a6fc4 100644 (file)
@@ -3,7 +3,7 @@
   "info": {
     "version": "1.0.0",
     "title": "opflex",
-    "description": "We are providing full API for configurational data which can be edited (by POST, PUT, PATCH and DELETE).\nFor operational data we only provide GET API.\n\nFor majority of request you can see only config data in examples. Thats because we can show only one example\nper request. The exception when you can see operational data in example is when data are representing\noperational (config false) container with no config data in it."
+    "description": "We are providing full API for configurational data which can be edited (by POST, PUT, PATCH and DELETE).\nFor operational data we only provide GET API.\n\nFor majority of request you can see only config data in examples. That is because we can show only one example\nper request. The exception when you can see operational data in example is when data are representing\noperational (config false) container with no config data in it."
   },
   "servers": [
     {
index f6fc795d5b6fe1636b3967546a2a27d8a841fbf6..e814441e0e3f5a3729ba4fb33ca2fd3e958885a5 100644 (file)
@@ -3,7 +3,7 @@
   "info": {
     "version": "1.0.0",
     "title": "path-params-test",
-    "description": "We are providing full API for configurational data which can be edited (by POST, PUT, PATCH and DELETE).\nFor operational data we only provide GET API.\n\nFor majority of request you can see only config data in examples. Thats because we can show only one example\nper request. The exception when you can see operational data in example is when data are representing\noperational (config false) container with no config data in it."
+    "description": "We are providing full API for configurational data which can be edited (by POST, PUT, PATCH and DELETE).\nFor operational data we only provide GET API.\n\nFor majority of request you can see only config data in examples. That is because we can show only one example\nper request. The exception when you can see operational data in example is when data are representing\noperational (config false) container with no config data in it."
   },
   "servers": [
     {
index 943f948d43b7be77a5b4f0384fccd4cfaf6795ea..e133f06d353185d7149c0e2f0b08c2c4ded349be 100644 (file)
@@ -3,7 +3,7 @@
   "info": {
     "version": "1.0.0",
     "title": "recursive",
-    "description": "We are providing full API for configurational data which can be edited (by POST, PUT, PATCH and DELETE).\nFor operational data we only provide GET API.\n\nFor majority of request you can see only config data in examples. Thats because we can show only one example\nper request. The exception when you can see operational data in example is when data are representing\noperational (config false) container with no config data in it."
+    "description": "We are providing full API for configurational data which can be edited (by POST, PUT, PATCH and DELETE).\nFor operational data we only provide GET API.\n\nFor majority of request you can see only config data in examples. That is because we can show only one example\nper request. The exception when you can see operational data in example is when data are representing\noperational (config false) container with no config data in it."
   },
   "servers": [
     {
index 6df0a4ca7e1117105f2872755ce86b4f745faf33..0214953dfe60044df1f507ba775190a92105956a 100644 (file)
@@ -3,7 +3,7 @@
   "info": {
     "version": "1.0.0",
     "title": "strings-from-regex",
-    "description": "We are providing full API for configurational data which can be edited (by POST, PUT, PATCH and DELETE).\nFor operational data we only provide GET API.\n\nFor majority of request you can see only config data in examples. Thats because we can show only one example\nper request. The exception when you can see operational data in example is when data are representing\noperational (config false) container with no config data in it."
+    "description": "We are providing full API for configurational data which can be edited (by POST, PUT, PATCH and DELETE).\nFor operational data we only provide GET API.\n\nFor majority of request you can see only config data in examples. That is because we can show only one example\nper request. The exception when you can see operational data in example is when data are representing\noperational (config false) container with no config data in it."
   },
   "servers": [
     {
index e965dc09ec08957935395b6cf3c35a7ae82a8738..feeb544e80ce3be8e27e96a3205f0c29a8e31c2a 100644 (file)
@@ -3,7 +3,7 @@
   "info": {
     "version": "1.0.0",
     "title": "string-types",
-    "description": "We are providing full API for configurational data which can be edited (by POST, PUT, PATCH and DELETE).\nFor operational data we only provide GET API.\n\nFor majority of request you can see only config data in examples. Thats because we can show only one example\nper request. The exception when you can see operational data in example is when data are representing\noperational (config false) container with no config data in it."
+    "description": "We are providing full API for configurational data which can be edited (by POST, PUT, PATCH and DELETE).\nFor operational data we only provide GET API.\n\nFor majority of request you can see only config data in examples. That is because we can show only one example\nper request. The exception when you can see operational data in example is when data are representing\noperational (config false) container with no config data in it."
   },
   "servers": [
     {
index 793b8fb15cea3173280dd3963020b964e260e8db..009de986e9d52fceafaabe769c78108454bb9c5d 100644 (file)
@@ -3,7 +3,7 @@
   "info": {
     "version": "1.0.0",
     "title": "test-container-childs",
-    "description": "We are providing full API for configurational data which can be edited (by POST, PUT, PATCH and DELETE).\nFor operational data we only provide GET API.\n\nFor majority of request you can see only config data in examples. Thats because we can show only one example\nper request. The exception when you can see operational data in example is when data are representing\noperational (config false) container with no config data in it."
+    "description": "We are providing full API for configurational data which can be edited (by POST, PUT, PATCH and DELETE).\nFor operational data we only provide GET API.\n\nFor majority of request you can see only config data in examples. That is because we can show only one example\nper request. The exception when you can see operational data in example is when data are representing\noperational (config false) container with no config data in it."
   },
   "servers": [
     {
index 4cf79d6487511b1ae2e8eb5fa42894f4f2edf286..d4b8bf7b90a0d672573d6b0b0e3e1d7a95dbaff0 100644 (file)
@@ -3,7 +3,7 @@
   "info": {
     "version": "1.0.0",
     "title": "toaster-augmented",
-    "description": "We are providing full API for configurational data which can be edited (by POST, PUT, PATCH and DELETE).\nFor operational data we only provide GET API.\n\nFor majority of request you can see only config data in examples. Thats because we can show only one example\nper request. The exception when you can see operational data in example is when data are representing\noperational (config false) container with no config data in it."
+    "description": "We are providing full API for configurational data which can be edited (by POST, PUT, PATCH and DELETE).\nFor operational data we only provide GET API.\n\nFor majority of request you can see only config data in examples. That is because we can show only one example\nper request. The exception when you can see operational data in example is when data are representing\noperational (config false) container with no config data in it."
   },
   "servers": [
     {
index 678ae379e8dbfd300a16116724112071bb838a91..545251d3f0412934cd7a0f1e042608d92068cf61 100644 (file)
@@ -3,7 +3,7 @@
   "info": {
     "version": "1.0.0",
     "title": "toaster",
-    "description": "We are providing full API for configurational data which can be edited (by POST, PUT, PATCH and DELETE).\nFor operational data we only provide GET API.\n\nFor majority of request you can see only config data in examples. Thats because we can show only one example\nper request. The exception when you can see operational data in example is when data are representing\noperational (config false) container with no config data in it."
+    "description": "We are providing full API for configurational data which can be edited (by POST, PUT, PATCH and DELETE).\nFor operational data we only provide GET API.\n\nFor majority of request you can see only config data in examples. That is because we can show only one example\nper request. The exception when you can see operational data in example is when data are representing\noperational (config false) container with no config data in it."
   },
   "servers": [
     {
index 1b95255a03d7ca62c608365a6b7333f543f8f34e..d5afc361e11c4f201ef0a0d17a7381ff8a2bd82e 100644 (file)
@@ -3,7 +3,7 @@
   "info": {
     "version": "1.0.0",
     "title": "toaster2",
-    "description": "We are providing full API for configurational data which can be edited (by POST, PUT, PATCH and DELETE).\nFor operational data we only provide GET API.\n\nFor majority of request you can see only config data in examples. Thats because we can show only one example\nper request. The exception when you can see operational data in example is when data are representing\noperational (config false) container with no config data in it."
+    "description": "We are providing full API for configurational data which can be edited (by POST, PUT, PATCH and DELETE).\nFor operational data we only provide GET API.\n\nFor majority of request you can see only config data in examples. That is because we can show only one example\nper request. The exception when you can see operational data in example is when data are representing\noperational (config false) container with no config data in it."
   },
   "servers": [
     {
index 63f4019493d8f4b9606c3ebfa9d28bff0b2df683..77ff3b4ef864229fb3e668e11a0c6333a28d1132 100644 (file)
@@ -3,7 +3,7 @@
   "info": {
     "version": "1.0.0",
     "title": "typed-params",
-    "description": "We are providing full API for configurational data which can be edited (by POST, PUT, PATCH and DELETE).\nFor operational data we only provide GET API.\n\nFor majority of request you can see only config data in examples. Thats because we can show only one example\nper request. The exception when you can see operational data in example is when data are representing\noperational (config false) container with no config data in it."
+    "description": "We are providing full API for configurational data which can be edited (by POST, PUT, PATCH and DELETE).\nFor operational data we only provide GET API.\n\nFor majority of request you can see only config data in examples. That is because we can show only one example\nper request. The exception when you can see operational data in example is when data are representing\noperational (config false) container with no config data in it."
   },
   "servers": [
     {