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

com.github.kongchen.swagger.docgen.reader.ResponseContainerConverter Maven / Gradle / Ivy

Go to download

A maven build plugin which helps you generate API document during build phase

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

import io.swagger.models.properties.ArrayProperty;
import io.swagger.models.properties.MapProperty;
import io.swagger.models.properties.Property;

/**
 * Property wrapper for response container.
 */
class ResponseContainerConverter {
    Property withResponseContainer(String responseContainer, Property property) {
        if ("list".equalsIgnoreCase(responseContainer)) {
            return new ArrayProperty(property);
        }
        if ("set".equalsIgnoreCase(responseContainer)) {
            return new ArrayProperty(property).uniqueItems();
        }
        if ("map".equalsIgnoreCase(responseContainer)) {
            return new MapProperty(property);
        }
        return property;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy