2 * Copyright (c) 2018 Inocybe Technologies and others. All rights reserved.
4 * This program and the accompanying materials are made available under the
5 * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6 * and is available at http://www.eclipse.org/legal/epl-v10.html
8 package org.opendaylight.netconf.sal.rest.doc.impl;
10 import java.util.Optional;
11 import org.opendaylight.mdsal.dom.api.DOMSchemaService;
14 * Base class for a bierman draft02 implementation.
16 * @author Thomas Pantelis
18 public abstract class BaseYangSwaggerGeneratorDraft02 extends BaseYangSwaggerGenerator {
20 private static final String PATH_VERSION = "draft02";
21 private static final String DEFAULT_BASE_PATH = "restconf";
22 private final String basePath;
24 protected BaseYangSwaggerGeneratorDraft02(final Optional<DOMSchemaService> schemaService) {
26 this.basePath = DEFAULT_BASE_PATH;
29 protected BaseYangSwaggerGeneratorDraft02(final Optional<DOMSchemaService> schemaService, final String basePath) {
31 this.basePath = basePath;
35 protected String getPathVersion() {
40 public String getResourcePath(final String resourceType, final String context) {
41 return "/" + basePath + "/" + resourceType + context;
45 public String getResourcePathPart(final String resourceType) {
50 protected ListPathBuilder newListPathBuilder() {
51 return key -> "/{" + key + "}";
55 protected void appendPathKeyValue(final StringBuilder builder, final Object value) {
56 builder.append(value).append('/');