X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=restconf%2Fsal-rest-docgen%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fnetconf%2Fsal%2Frest%2Fdoc%2Fmountpoints%2FMountPointSwagger.java;h=89a75b0c2834d9f27bd2671935bbaa0068f869d9;hb=2678c08c680a02e5acbcbed30b8c966e8f5552dc;hp=b20aa967b9e66f38a37cb1ee59e353a51190c15d;hpb=01a3b9adce74d7c6a10646ebbf0a3f4998a76d41;p=netconf.git diff --git a/restconf/sal-rest-docgen/src/main/java/org/opendaylight/netconf/sal/rest/doc/mountpoints/MountPointSwagger.java b/restconf/sal-rest-docgen/src/main/java/org/opendaylight/netconf/sal/rest/doc/mountpoints/MountPointSwagger.java index b20aa967b9..89a75b0c28 100644 --- a/restconf/sal-rest-docgen/src/main/java/org/opendaylight/netconf/sal/rest/doc/mountpoints/MountPointSwagger.java +++ b/restconf/sal-rest-docgen/src/main/java/org/opendaylight/netconf/sal/rest/doc/mountpoints/MountPointSwagger.java @@ -9,7 +9,6 @@ package org.opendaylight.netconf.sal.rest.doc.mountpoints; import com.google.common.base.Optional; import java.util.Collections; -import java.util.Comparator; import java.util.HashMap; import java.util.LinkedList; import java.util.List; @@ -43,12 +42,7 @@ public class MountPointSwagger extends BaseYangSwaggerGenerator implements Mount private DOMMountPointService mountService; private final Map instanceIdToLongId = new TreeMap<>( - new Comparator() { - @Override - public int compare(final YangInstanceIdentifier o1, final YangInstanceIdentifier o2) { - return o1.toString().compareToIgnoreCase(o2.toString()); - } - }); + (o1, o2) -> o1.toString().compareToIgnoreCase(o2.toString())); private final Map longIdToInstanceId = new HashMap<>(); private final Object lock = new Object(); @@ -116,7 +110,6 @@ public class MountPointSwagger extends BaseYangSwaggerGenerator implements Mount return null; // indicating not found. } SchemaContext context = getSchemaContext(iid); - String urlPrefix = getYangMountUrl(iid); if (context == null) { return createResourceList(); } @@ -125,6 +118,7 @@ public class MountPointSwagger extends BaseYangSwaggerGenerator implements Mount dataStores.setDescription("Provides methods for accessing the data stores."); dataStores.setPath(generatePath(uriInfo, DATASTORES_LABEL, DATASTORES_REVISION)); resources.add(dataStores); + String urlPrefix = getYangMountUrl(iid); ResourceList list = super.getResourceListing(uriInfo, context, urlPrefix); resources.addAll(list.getApis()); list.setApis(resources); @@ -172,8 +166,6 @@ public class MountPointSwagger extends BaseYangSwaggerGenerator implements Mount } private ApiDeclaration generateDataStoreApiDoc(final UriInfo uriInfo, final String context) { - - ApiDeclaration declaration = super.createApiDeclaration(createBasePathFromUriInfo(uriInfo)); List apis = new LinkedList<>(); apis.add(createGetApi("config", "Queries the config (startup) datastore on the mounted hosted.", context)); @@ -181,6 +173,8 @@ public class MountPointSwagger extends BaseYangSwaggerGenerator implements Mount "Queries the operational (running) datastore on the mounted hosted.", context)); apis.add(createGetApi("operations", "Queries the available operations (RPC calls) on the mounted hosted.", context)); + + ApiDeclaration declaration = super.createApiDeclaration(createBasePathFromUriInfo(uriInfo)); declaration.setApis(apis); return declaration;