2 * Copyright (c) 2014 Cisco Systems, Inc. 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.swagger;
10 import java.util.List;
11 import org.json.JSONObject;
14 * Implementation of swagger spec (see <a href=
15 * "https://github.com/wordnik/swagger-spec/blob/master/versions/1.2.md#52-api-declaration"
16 * > https://github.com/wordnik/swagger-spec/blob/master/versions/1.2.md#52-api-
19 public class ApiDeclaration {
20 private String apiVersion;
21 private String swaggerVersion;
22 private String basePath;
23 private String resourcePath;
24 private List<String> produces;
25 private List<Api> apis;
26 private JSONObject models;
28 public JSONObject getModels() {
32 public void setModels(JSONObject models) {
36 public String getApiVersion() {
40 public void setApiVersion(String apiVersion) {
41 this.apiVersion = apiVersion;
44 public String getSwaggerVersion() {
45 return swaggerVersion;
48 public void setSwaggerVersion(String swaggerVersion) {
49 this.swaggerVersion = swaggerVersion;
52 public String getBasePath() {
56 public void setBasePath(String basePath) {
57 this.basePath = basePath;
60 public String getResourcePath() {
64 public void setResourcePath(String resourcePath) {
65 this.resourcePath = resourcePath;
68 public List<String> getProduces() {
72 public void setProduces(List<String> produces) {
73 this.produces = produces;
76 public List<Api> getApis() {
80 public void setApis(List<Api> apis) {
84 public boolean hasApi() {
85 return (apis != null && !apis.isEmpty());
88 public boolean hasModel() {
89 return (models != null && models.length() > 0);