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

pub.codex.apix.doc.ApiDocument Maven / Gradle / Ivy

There is a newer version: 5.0.2
Show newest version
package pub.codex.apix.doc;

import pub.codex.apix.schema.ApiDescription;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

public class ApiDocument {

    private String path;

    private String methodName;

    private List> operations;

    public ApiDocument(ApiDescription apiDescription) {

        this.path = apiDescription.getPath();
        this.methodName = apiDescription.getMethodName();

        if (apiDescription.getOperations().size() > 0) {
            operations = new ArrayList<>();
            apiDescription.getOperations().forEach(operation -> {
                Map map = new HashMap<>();
                map.put("method", operation.getMethod().toString());
                map.put("summary", operation.getSummary());
                map.put("params", operation.getParams());
                map.put("paramsBody", operation.getParamsBody());
                this.operations.add(map);
            });
        }
    }


    public String getPath() {
        return path;
    }

    public String getMethodName() {
        return methodName;
    }

    public List> getOperations() {
        return operations;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy