All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.github.kongchen.swagger.docgen.mustache.MustacheApi Maven / Gradle / Ivy

There is a newer version: 3.1.8
Show newest version
package com.github.kongchen.swagger.docgen.mustache;

import java.util.LinkedList;
import java.util.List;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.wordnik.swagger.core.DocumentationEndPoint;

public class MustacheApi {
    int apiIndex;

    String path;

    String url;

    List operations = new LinkedList();

    @JsonIgnore
    private int opIndex = 1;

    public MustacheApi(String basePath, DocumentationEndPoint api) {
        this.path = api.getPath();
        if (this.path != null && !this.path.startsWith("/")) {
            this.path = "/" + this.path;
        }
        this.url = basePath + api.getPath();
    }

    public void addOperation(MustacheOperation operation) {
        operation.setOpIndex(this.opIndex++);
        operations.add(operation);
    }

    public int getApiIndex() {
        return apiIndex;
    }

    public void setApiIndex(int apiIndex) {
        this.apiIndex = apiIndex;
    }

    public String getPath() {
        return path;
    }

    public void setPath(String path) {
        this.path = path;
    }

    public String getUrl() {
        return url;
    }

    public void setUrl(String url) {
        this.url = url;
    }

    public List getOperations() {
        return operations;
    }

    public void setOperations(List operations) {
        this.operations = operations;
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy