io.muserver.openapi.DiscriminatorObject Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of mu-server Show documentation
Show all versions of mu-server Show documentation
A simple but powerful web server framework
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 DiscriminatorObjectBuilder
*/
public class DiscriminatorObject implements JsonWriter {
public final String propertyName;
public final Map mapping;
DiscriminatorObject(String propertyName, Map mapping) {
notNull("propertyName", propertyName);
this.propertyName = propertyName;
this.mapping = mapping;
}
@Override
public void writeJson(Writer writer) throws IOException {
writer.write('{');
boolean isFirst = true;
isFirst = append(writer, "propertyName", propertyName, isFirst);
isFirst = append(writer, "mapping", mapping, isFirst);
writer.write('}');
}
}