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

io.muserver.openapi.RequestBodyObject Maven / Gradle / Ivy

There is a newer version: 2.0.3
Show newest version
package io.muserver.openapi;

import java.io.IOException;
import java.io.Writer;
import java.util.Map;

import static io.muserver.Mutils.notNull;
import static io.muserver.openapi.Jsonizer.append;

/**
 * @see RequestBodyObjectBuilder
 */
public class RequestBodyObject implements JsonWriter {

    public final String description;
    public final Map content;
    public final boolean required;

    RequestBodyObject(String description, Map content, boolean required) {
        notNull("content", content);
        this.description = description;
        this.content = content;
        this.required = required;
    }

    @Override
    public void writeJson(Writer writer) throws IOException {
        writer.write('{');
        boolean isFirst = true;
        isFirst = append(writer, "description", description, isFirst);
        isFirst = append(writer, "content", content, isFirst);
        isFirst = append(writer, "required", required, isFirst);
        writer.write('}');
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy